Example 1
#include <stdio.h>
#include <string.h>
int main(void) {
char a[32] = "Hello";
char b[32];
strcpy(b, a);
strcat(b, ", C");
printf("b: %s (len %zu)\n", b, strlen(b));
printf("cmp: %d\n", strcmp(a, "Hello"));
return 0;
} How It Works
strcpycopies"Hello"intob.strcatappends", C"after the existing terminator.strcmpreturns 0 becauseastill equals"Hello".
