incompatible pointer type conversion warning in C socket programming -
list *attachnode(list *tmp,list *hd)//function ip address { if(hd==null) { hd=tmp; } else { tmp->next=hd; hd=tmp; } return(hd); }
tmp->next=hd giving warning of incompatible type pointer conversion default "next" list type.
you say, "next" "list type" believe should "list *" type
but without typedef cannot sure
okay, comment, edith:
it should typedef struct list {...; struct list *next;} list;
the reason is, c need forward declaration, else not determine "type" of next. visualication: typedef struct {xxx *next;} yyy;
Comments
Post a Comment