执行过程中在c中出现下述错误提示:
scanf : floating point formats not linked
Abnormal program termination
然后中断退出执行;但在VC中可以正确执行,不知为什么???!!!请指教
scanf : floating point formats not linked
Abnormal program termination
然后中断退出执行;但在VC中可以正确执行,不知为什么???!!!请指教
是不是%后面的在c里不认呢??
#define NULL 0
#define LEN sizeof(struct student)
struct student
{
long num;
float score;
struct student *next;
};
int n;struct student *creat(void)
{
struct student *head;
struct student *p1,*p2; n=0;
p1=p2=(struct student *)malloc(LEN);
scanf("%ld%f",&p1->num,&p1->score);
head=NULL;
while(p1->num!=0)
{
n=n+1;
if(n==1)
head=p1;
else
p2->next=p1;
p2=p1;
p1=NULL;
p1=(struct student *)malloc(LEN);
scanf("%ld%f",&p1->num,&p1->score);
}
p2->next=NULL;
return(head);
}
main里会调用create函数,scanf写的应该没有错误吧!
WaitForSingleObject()可以将线程变成等待,可怎么恢复;还有就是这个函数有个参数就是需要一个句柄,这个句柄可以是线程的吗?
不知道楼主是如何输入数据的?用什么来分割输入?不是","吧!?
SuspendThread()暂停,ResumeThread()开始。
另外,在创建时CreateThread的CreationFlags参数如果是CREATE_SUSPENDED则线程诞生就暂停。
同时TC在过去一直对浮点值用scanf是会出问题(BUG),如浮点数组赋值!