hxlou520 发表于 2008-9-8 10:38

"鏈表問題" 請各位高手指教下

建立一个三个结点的链表,存放学生数据。为简单起见, 我们假定学生数据结
构中只有学号和年龄两项。

#define NULL 0
#define TYPE struct stu
#define LEN sizeof(struct stu)
struct stu
{
  int num;
  int age;
  struct stu *next;
};

TYPE *creat(int n)
{
  struct stu *head,*pf,*pb;
  int i;
  for(i=0;i<n;i++)
  {
    pb=(TYPE*)malloc(LEN);
    printf("\ninput Number and Age:\n");
    scanf("%d,%d",&pb->num,&pb->age);
    if(i==0)
     pf=head=pb;
    else
     pf->next=pb;
     pb->next=NULL;
     pf=pb;
   }
   return(head);
}

提示:Linker Error:Undefined symbol _main in module c0.ASM
這是什麼問題啊?

hxlou520 发表于 2008-9-8 12:01

此問題已經解決,感謝各位進來看下我的貼....

GaFu 发表于 2008-9-8 19:01

没主函数

ironbridge 发表于 2008-9-8 19:12

你把解决的贴出来啊,
混蛋楼主

页: [1]

编程论坛