if I have the function scopy that copies a C String from src to dest
char * scopy(char *dest, char *src) {
char* r = dest;
while (*src != '\0') {
*dest = *src;
dest++;
src++;
}
*dest = *src;
return r;
}
Why does this function work when called on 2 String initialized like this char a[6] = "abbbb" and char b[4] = "dcd" but doesn't work on Strings initialized like this char * a = "abbbb" and char * b = "dcd"