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

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -

php - Accessing static methods using newly created $obj or using class Name -