估计是指针的问题,一大堆错误,请问哈什么问题
#include <stdio.h> #include <malloc.h>
static int MAX_INPUT = 1000;
typedef struct TLink {
int a;
struct TLink *next;
} TL;
void main()
{
int inputN;
TL firstN;
TL nextN;
inputN = 0;
firstN.a = 1;
nextN = CreateNext(firstN);
nextN.a = 0;
printf("%d",nextN.a);
}
TL *CreateNext(TL *n)
{
TL *p;
p = &((TL *)malloc(sizeof(*n)));
if(p == 0) printf("分配内存出错!");
else *n.next=*p;
return *p;
}