c - dereferencing pointer to incomplete type on a linkedlist -
i error "dereferencing pointer incomplete type" , don't know why. saw others many post didn't finde error please help me :) here struct:
typedef struct _linkedlist{ int info; int cont; struct _linkedlist* next; struct _linkedlist* prew; } linkedlist; and position error:
linkedlist* p; int pos = 0; while(pre->prew->cont < pre->cont && pre->prew != null){ p = pre->prew; if(p->prew != *head){ p->prew->next = pre; pre->prew = p->prew; p->next = pre->next; p->prew = pre; pre->next->prew = p; //error pre->next = p; pos++; }else{ p->next = pre->next; pre->next->prew = p; //error pre->next = p; p->prew = pre; *head = pre; } } where variable "pre" head of list. , why compiler dont give me error in :
p->prew->next = pre; thanks :)
you have typo in struct name next, there says _linkedlist instead of _linkedlist:
struct _linkedlist* next; struct _linkedlist* prew; c
No comments:
Post a Comment