标题:简单的动态链表建立 按书上写的 结果报错了/???????
取消只看楼主
C_596322153
Rank: 6Rank: 6
来 自:徽州
等 级:侠之大者
帖 子:182
专家分:466
注 册:2012-1-10
结帖率:100%
已结贴  问题点数:50 回复次数:1 
简单的动态链表建立 按书上写的 结果报错了/???????
程序代码:
#include "stdio.h"
#include "malloc.h"
#define LEN sezeof(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 = (struct student * ) malloc(LEN);
      scanf("%ld,%f",&p1->num,&p1->score);
   }
   p2->next = NULL;
   return(head);
}

报错信息:

 warning C4013: 'sezeof' undefined; assuming extern returning int
: error C2143: syntax error : missing ')' before 'type'
: error C2143: syntax error : missing ')' before 'type'

求指点下   谢谢了

搜索更多相关主题的帖子: next color 动态 
2012-03-16 10:03
C_596322153
Rank: 6Rank: 6
来 自:徽州
等 级:侠之大者
帖 子:182
专家分:466
注 册:2012-1-10
得分:0 
呵呵   偶错了
2012-03-16 13:23



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-363354-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.234330 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved