文件 DoubleList.h
文件 DoubleList.h
typedef struct DulNode{
int data;
struct DulNode *prior;
struct DulNode *next;
}DulNode;
文件 DoubleList.c
Head *InitLink(){
printf("请输入节点的值,0为结束标志:");
Head *p;
DulNode *q,*s;
int elem;
p = (struct Head *)malloc(sizeof(Head));
p->head = NULL;p->lenght = 0;
q=(DulNode*)malloc(sizeof(DulNode));
scanf("%d",&elem);
while(elem){
s =(DulNode*)malloc(sizeof(DulNode));
s->data = elem;
if(p->head == NULL){
p->head = s;
p->lenght+=1;
s->prior = s;
s->next = s;
q = s;
}
else{
q->next = s;
s->prior = q;
q->prior = s;
s->next = q;
p->lenght+=1;
}
scanf("%d",&elem);
}
free(q);
return p;
}
typedef struct Head{
int lenght;
struct DulNode *head;
}Head;
请问为什么会报 'Head' : illegal use of this type as an expression错误.哪位大侠能帮帮忙.小弟非常感激.
lude "stdlib.h" /*加入这个头文件原因函数名称:malloc函数原型:void * malloc(unsigned size);函数功能:分配size字节的存储区函数返回:所分配的内存区地址,如果内存不够,返回0参数说明:所属文件:<stdlib.h>...