#include void copy1(const char *from, char *to); void copy2(const char *from, char *to); int main(void) { char *str1 = "おれは", str2[10], str3[] = "浅川だ", str4[10]; copy1(str1, str2); printf("str1 = (%s)\n", str1); copy2(str3, str4); printf("str3 = (%s)\n", str3); return 0; } void copy1(const char *from, char *to) { int i; for (i=0; to[i] = from[i]; i++) ; } void copy2(const char *from, char *to) { for ( ; *to = *from; from++, to++) ; }