“ scanf :floating point formats not linked Abnormal program teqmination. ”
是什么错误啊?
这个错误要怎么解决
请帮帮忙~~~~~~~~~
“ scanf :floating point formats not linked Abnormal program teqmination. ”
是什么错误啊?
这个错误要怎么解决
请帮帮忙~~~~~~~~~
2006-08-08 22:40
2006-08-08 22:50
typedef struct
{ char name[20];
float score[3];
}STUDENT;
main()
{ STUDENT stu[3];
int i;
for(i=1;i<=3;i++)
{ scanf("%s",stu[i].name);
scanf("%f %f %f",&stu[i].score[0],&stu[i].score[1],&stu[i].score[2]);
printf("%s %.2f %.2f %.2f",stu.name,stu[i].score[0],stu[i].score[1],stu[i].score[2]);
}
}
——————————————————————————————————————————————
我改写成:
typedef struct
{ char name[20];
float score[3];
}STUDENT;
main()
{ STUDENT stu
scanf("%s",stu.name);
scanf("%f %f %f",&stu.score[0],&stu.score[1],&stu.score[2]);
printf("%s %.2f %.2f %.2f",stu.name,stu.score[0],stu.score[1],stu.score[2]);
}
}
就没有刚才那种错误! 这是为什么?
2006-08-08 23:01
2006-08-08 23:07
2006-08-08 23:14
typedef struct
{ char name[20];
float score[3];
}STUDENT;
main()
{ STUDENT stu[3];
int i;
for(i=0;i<3;i++)
{ scanf("%s",stu[i].name);
scanf("%f %f %f",&stu[i].score[0],&stu[i].score[1],&stu[i].score[2]);
printf("%s %.2f %.2f %.2f",stu[i].name,stu[i].score[0],stu[i].score[1],stu[i].score[2]);
}
}
——————————————————————————————————————————————
我改写成:
typedef struct
{ char name[20];
float score[3];
}STUDENT;
main()
{ STUDENT stu
scanf("%s",stu.name);
scanf("%f %f %f",&stu.score[0],&stu.score[1],&stu.score[2]);
printf("%s %.2f %.2f %.2f",stu.name,stu.score[0],stu.score[1],stu.score[2]);
}
}
就没有刚才那种错误! 这是为什么?

2006-08-08 23:16
最起码有地址越界了.
这什么意思?
找不到问题啊
请帮帮
2006-08-08 23:23

2006-08-08 23:31
我貌似没有访问stu[3]啊
2006-08-09 00:11
typedef struct
{ char name[20];
float score[3];
}STUDENT;
main()
{ STUDENT stu[3];
int i;
for(i=1;i<=3;i++)
{ scanf("%s",stu[i].name);
scanf("%f %f %f",&stu[i].score[0],&stu[i].score[1],&stu[i].score[2]);
printf("%s %.2f %.2f %.2f",stu.name,stu[i].score[0],stu[i].score[1],stu[i].score[2]);
}
}
——————————————————————————————————————————————
我改写成:
typedef struct
{ char name[20];
float score[3];
}STUDENT;
main()
{ STUDENT stu
scanf("%s",stu.name);
scanf("%f %f %f",&stu.score[0],&stu.score[1],&stu.score[2]);
printf("%s %.2f %.2f %.2f",stu.name,stu.score[0],stu.score[1],stu.score[2]);
}
}
就没有刚才那种错误! 这是为什么?
看清楚你的循环结束条件

2006-08-09 09:59