回答編集履歴
1
追記
answer
CHANGED
@@ -1,4 +1,45 @@
|
|
1
1
|
こんにちは。
|
2
2
|
|
3
3
|
恐らく、printf文の前に「全角」の空白文字があります。
|
4
|
-
「半角」の空白文字へ置き換えれば消えると思います。
|
4
|
+
「半角」の空白文字へ置き換えれば消えると思います。
|
5
|
+
|
6
|
+
---
|
7
|
+
【追記】
|
8
|
+
取り敢えず、下記にてビルドして実行しても落ちなくなりました。
|
9
|
+
変更箇所にマークしましたので、何が問題だったのか良く考えてみてください。
|
10
|
+
```C
|
11
|
+
#include <stdio.h> // ここ
|
12
|
+
#include <string.h>
|
13
|
+
|
14
|
+
struct student {
|
15
|
+
int year; /* 学年 */
|
16
|
+
int clas; /* クラス */
|
17
|
+
int number; /* 出席番号 */
|
18
|
+
char name[64]; /* 名前 */
|
19
|
+
double stature; /* 身長 */
|
20
|
+
double weight; /* 体重 */
|
21
|
+
};
|
22
|
+
|
23
|
+
void student_print(struct/*←ここ*/ student data[],int count);
|
24
|
+
|
25
|
+
int main(void)
|
26
|
+
{
|
27
|
+
student data[] = { 1,2,3,"A",12.3,45.6};
|
28
|
+
student_print(/*ここ*/data,/*ここ*/ 1/*←ここ*/);
|
29
|
+
return 0/*←ここ*/;
|
30
|
+
}
|
31
|
+
|
32
|
+
void student_print(struct/*←ここ*/ student data[],int count)
|
33
|
+
{
|
34
|
+
int i;
|
35
|
+
for (i = 0;i < count;i++) {
|
36
|
+
printf("[学年]:%d\n",data[i].year);
|
37
|
+
printf("[クラス]:%d\n",data[i].clas);
|
38
|
+
printf("[出席番号]:%d\n",data[i].number);
|
39
|
+
printf("[名前]:%s\n",data[i].name);
|
40
|
+
printf("[身長]:%f\n",data[i].stature);
|
41
|
+
printf("[体重]:%f\n",data[i].weight);
|
42
|
+
}
|
43
|
+
return;
|
44
|
+
}
|
45
|
+
```
|