Hi
I am new to linux c programming and i have a simple program just for learning and when i compile it it gives me error "dereferencing pointer to incomplete type" here is my code
struct Node
{
struct Node* left;
struct Node* middle;
struct Node* right;
int nodeData;
int nodeLevel;
char isVisted;
};
struct ListNode
{
struct Node* data;
struct ListNode* next;
};
struct List
{
struct NodeList* head;
struct NodeList* tail;
int count;
};
typedef struct ListNode ListNode;
typedef struct Node Node;
typedef struct List List;
ListNode* InitListNode(Node* data)
{
ListNode* listNode=(ListNode*)calloc(1,sizeof(ListNode));
listNode->data=data;
listNode->next=NULL;
return listNode;
}
List* InitList()
{
List* list=(List*)calloc(1,sizeof(List));
list->count=0;
list->head=list->tail=NULL;
}
void EnQue(Node* data,List* que)
{
if(que->count==0)
{
que->tail=que->head=InitListNode(data);
que->count++;
}
else
{
que->tail->next=InitListNode(data); //here error is problem comes
que->tail=que->tail->next;//here error is problem comes
que->count++;
}
}
please help..