我在声明结构时犯了错误吗?我试着根据这个错误检查几个其他类似的问题,但仍然无法找到解决方案。需要你的帮助来解决它。感谢提前。C结构错误:取消引用指向不完整类型的指针
#include <stdio.h>
#include <stdlib.h>
struct Node{
int info;
struct node *link;
} ;
void display(struct node *start);
int main()
{
struct node *start=NULL;
int choice;
int num;
while(1)
{
printf("\n1. Display \n9. Exit \n");
printf("\nEnter your choice\n\n\n");
scanf("%d",&choice);
switch(choice)
{
case 1:
display(start);
break;
default:
printf("\nInvalid choice");
}
}
}
void display(struct node *start)
{
struct node *p;
if(start==NULL)
{
printf("List Is Empty");
return;
}
p=start;
while(p!=NULL)
{
printf("%d",p->info); // Getting Error in these 2 Lines
p=p->link; // Getting Error in these 2 Lines
}
}
'结构没有Node'不是与'struct node'相同的东西。 – aschepler
@aschelper谢谢,我不知道,它工作。感谢帮助。 Cud你解释他们之间的区别? – harsher
区别是大写N :)。开玩笑。 * C *区分大小写。 –