程序运行中为什么突然终止

来源:百度知道 编辑:UC知道 时间:2024/05/17 11:50:51
我使用的是TC2.0,编了一个学生信息管理系统,能运行,但在输入学生电话后程序终止,出现
scanf:floating point formats not linked
Abnormal program termination
我用的是scanf("%l%l",p->mobilenum,p->roomnum);
这是怎么回事啊?
刚才打错了,是
scanf("%l%l",&p->mobilenum,&p->roomnum);

没有连接浮点库.这是TC的一个BUG.
你只要在程序加个float arg,*pointer=&arg;就行了,
这样就连接了浮点库,
其中arg,*pointer只要是和程序不同名的变量就可以了。

你试试分下来scanf:
scanf("%l",&p->mobilenum);
scanf("%l",&p->roomnum);
---------------------------------
看了楼上的,我想起来了,确实有这样的BUG,自己还遇到过,当时郁闷了好长时间,老师也不知道怎么解决,现在终于明白了,太感谢了

建议不要用tc了,这么老