I\'m perplexed as to why the following doesn\'t work:
char * f = \"abcdef\";
strcpy(f, \"abcdef\");
printf(\"%s\",f);
char s[] = \"ffffd\";
strcpy(&s[0],
In the first example, you have a pointer to a string literal. This pointer should really be const char *, because any attempt to modify a string literal is undefined behaviour. However, for legacy reasons allows you to use a char * to point at it. But you still shouldn't be trying to modify it.
In the second version, you have a bog-standard array, whose contents happen to be initialised to be equivalent to your string. This is modifiable, as it's your array.