#include <stdio.h> #include <string.h> // for memset #include <stdlib.h> // for calloc
int main() { char* ch = calloc(15, sizeof(char)); memset(ch, 'A', 14); printf("%s\n", ch); memset(ch + 3, '\0', 1); printf("%s\n", ch); memset(ch + 3, 'B', 1); printf("%s\n", ch); return 0; } /* AAAAAAAAAAAAAA AAA AAABAAAAAAAAAA */
|