执行过程中在c中出现下述错误提示:
 scanf : floating point formats not linked
Abnormal program termination
然后中断退出执行;但在VC中可以正确执行,不知为什么???!!!请指教 

解决方案 »

  1.   

    你的scanf是如何写的呢,贴上来
    是不是%后面的在c里不认呢??
      

  2.   

    不好意思,程序如下:
    #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写的应该没有错误吧!
      

  3.   

    各位大侠可以简单在c里试一下,vc里是正确的!!
      

  4.   

    scanf("%ld%f",&p1->num,&p1->score);%ld   c语言里认吗
      

  5.   

    WaitForSingleObject()这个函数应可以达到你的要求的
      

  6.   

    C语言里认的,我确定是第二个%f的毛病,因为改成int和%d后,错误消失!
    WaitForSingleObject()可以将线程变成等待,可怎么恢复;还有就是这个函数有个参数就是需要一个句柄,这个句柄可以是线程的吗?
      

  7.   

    scanf从语法上来看没问题。
    不知道楼主是如何输入数据的?用什么来分割输入?不是","吧!?
      

  8.   

    至于线程,我只知道在VC里的方法。
    SuspendThread()暂停,ResumeThread()开始。
    另外,在创建时CreateThread的CreationFlags参数如果是CREATE_SUSPENDED则线程诞生就暂停。
      

  9.   

    TC实在是有些历史了哦:)对于TC中,double型为8字节,用scanf在调用的时候对于现在的系统就有可能出问题!
    同时TC在过去一直对浮点值用scanf是会出问题(BUG),如浮点数组赋值!