找错~链表的创建
#include<stdio.h>#include<stdlib.h>
#define NULL 0
#define TYPE struct stu
#define LEN sizeof(struct stu)
struct stu
{
int age;
struct stu *next;
};
TYPE *creat(int n)
{
struct stu *head,*pb,*pf;
int i;
for(i=0;i<n;i++)
{
pb=(TYPE*)malloc(LEN);
printf("input student imformation:");
scanf("%d",&pb->age);
if(i==0)
pb=head=pf;
else
pf->next=pb;
pb->next=NULL;
pf=pb;
}
return(head);
}
看看哪地方出错了