#include <stdio.h>
#include <string.h>
void main() {
char *strcopy(char *target, char *source);
char a[] = "hello world~";
strcopy(a,"thanks!");
printf("%s\n",a);
getchar();
}
char *strcopy(char *target,char *source) {
char *p = target;
if (strlen(target) < strlen(source)) {
return NULL;
}
while (*target++ = *source++) {
if (*source == '\0') {
break;
}
}
*target = '\0';
return p;
}