- 252 名前:デフォルトの名無しさん mailto:sage [2008/07/16(水) 08:32:55 ]
- >>250
文字列の終端はどうするの? #include<stdio.h> struct tfield{ char str1; }; int main(void){ struct tfield name[10]; char buf[10+1]=""; int i; fgets(buf, sizeof(buf), stdin); for(i=0;buf[i];i++) name[i].str1=buf[i]; // for(i=0;name[i].str1=buf[i];i++); for(i=0;i<10;i++) printf("%c\n", name[i].str1); return 0; }
|

|