链式表定义 分配空间语句错误 求大神帮忙看看
程序代码:
#include<stdio.h> #include<malloc.h> #include<conio.h> #define len sozeof(struct student); #define null 0; struct student //声明 {long num; int score; student *next; }; int n; struct student *creat() //创建单链表 {struct student *head; struct student *p1,*p2; n=0; p1=p2=(struct student*)malloc(len); //这里报错:“student”的前面应有“)” “sozeof”: 找不到标识符 scanf("%ld,%d",&p1->num,&p1->score); head=null; while(p1->num!=0) {n=n+1; if(n==1) head=p1; else p2->next; p2=p1; p1=(struct student *)malloc(len); scanf("%ld%d\n",&p1->score); } p2->next=null; return(head); } 最好有关于malloc函数使用方法和范本,谢谢