c++编程时出错(菜鸟级),呼叫高手!!!

来源:百度知道 编辑:UC知道 时间:2024/05/29 19:03:28
struct xuesheng
{
char xm[20];
float sx; /*就是这里,改用浮点型就会在录入时出错,int就没错了*/
int yw;
int yy;
int wl;
int hx;
}sj[100];

void luru()
{
int i,n;
system("cls");
printf("\\*******************************************");
printf("\n* 1.lu ru xue sheng xin xi. *");
printf("\n*******************************************");
printf("\nlu ru ji ge:");
scanf("%d",&n);
getchar();
for(i=0;i<n;i++)
{
system("cls");
printf("\*******************************************");
printf("\n* 1.lu ru xue sheng xin xi. *");
printf("\n*******************************************");
printf("\nxuesheng%d:",i+1);
printf("\nxingming:&quo

在使用scanf得到float前,必须出现过float变量的值!

改成
printf("shuxue:");
sj[i].sx=0;
scanf("%f",&sj[i].sx); /* 这里 */

C Run-Time Error R6002
floating-point support not loaded
The necessary floating-point library was not linked.

Possible causes
The program was compiled or linked with an option, such as /FPi87, that requires a coprocessor, but the program was run on a machine that did not have a coprocessor installed.
A format string for a printf or scanf function contained a floating-point format specification and the program did not contain any floating-point values or variables.
The compiler minimizes a program's size by loading floating-point support only when necessary. The compiler cannot de