#include #define SIZE 20 void string_copy( char *to, char *from ){ int i; i = 0; while ( from[i] != '\0' ){ to[i] = from[i]; i++; } to[i] = '\0'; } int main(void){ char a[SIZE], b[SIZE]; printf("文字列(空白無し)を一つ入力してください:"); scanf("%s", a); string_copy(b, a); printf("コピーした文字列:<%s>\n", b); string_copy( b, &a[1] ); printf("1 文字ずらしてコピーした文字列:<%s>\n", b); return 0; }