大家来看一下,高级程序员书到的这段代码是不是有问题
在高级程序员书到的第384页
struct intNode * inNode(void)
{int d;struct intNode *p;
printf("输入插入表元的值");
scanf("%d",&d);
p=(struct intNode *)malloc(sizeof(struct intNode));
p->value=d;
p->next=head;//就是这名话是不是有问题
//应该还有这句head=p;
return p;
}
这是线性表的内容;
还有在383页的
struct intNode * createList()
的这句好像也有问题:else tail=tail->next=p;
不知道我说得对不对,但我在这里看了很久都看不懂