構造を宣言するのは間違いでしたか?私はこのエラーに基づいていくつかの他の同様の質問をチェックしようとしたが、解決策を見つけることができなかった。それを解決するためにあなたの助けが必要です。アドバンスで感謝します。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ありがとう、私はそれを知らなかった。それは働いた。手伝ってくれてありがとう。あなたはそれらの違いを説明してくれる? – harsher
違いは大文字Nです。冗談だ。 * C *は大文字と小文字を区別します。 –