Sunday, 15 August 2010

C: error: dereferencing pointer to incomplete type -



C: error: dereferencing pointer to incomplete type -

i'm getting error (error: dereferencing pointer incomplete type ) adddata->s = s , adddata->type = type, , i'm not sure why... seems should work me (i'm bit rusty c, however)

here's code:

int addsym(char *s, var_type type){ struct syment* adddata= malloc(sizeof(syment)); adddata->s = s; adddata->type = type;

...

i have syment as

typedef struct syment_s { char *s; int offset; var_type type; struct syment_s *next; }*syment;

thanks!

try changing

typedef struct syment_s { char *s; int offset; var_type type; struct syment_s *next; }*syment;

to

typedef struct syment_s { char *s; int offset; var_type type; struct syment_s *next; } syment;

pointer overload , not crufts (pointer dog, crufts dog show).

c pointers struct

No comments:

Post a Comment