回答編集履歴
2
追記
answer
CHANGED
@@ -3,5 +3,7 @@
|
|
3
3
|
↓
|
4
4
|
fscanf(fp, "%d,%s,%d,%d,%d", &f1, str ,&f2, &f3, &f4);
|
5
5
|
|
6
|
+
> name[i] = str;
|
7
|
+
|
6
8
|
文字列は直接代入できません。
|
7
9
|
[strcpy()](http://www.c-tipsref.com/reference/string/strcpy.html)を使いましょう。
|
1
追記
answer
CHANGED
@@ -1,4 +1,7 @@
|
|
1
1
|
> fscanf(fp, "%d,%c,%d,%d,%d", &f1, str ,&f2, &f3, &f4);
|
2
2
|
|
3
3
|
↓
|
4
|
-
fscanf(fp, "%d,%s,%d,%d,%d", &f1, str ,&f2, &f3, &f4);
|
4
|
+
fscanf(fp, "%d,%s,%d,%d,%d", &f1, str ,&f2, &f3, &f4);
|
5
|
+
|
6
|
+
文字列は直接代入できません。
|
7
|
+
[strcpy()](http://www.c-tipsref.com/reference/string/strcpy.html)を使いましょう。
|