I am of late working on gcc compiler. whenevr i m compiling my code, m encountering problem with declaration of structure. How to tackle this problem. Do i need to write the syntax differently in gcc?. 开发者_如何学运维if yes, how? please suggest something.
I am reasonably sure gcc conforms to C standards, for a more succinct explanation than one found in the standard, please, turn to pages 148-150 of C: A Reference Manual.
So something simple like this linked list element:
struct foo
{
int a;
float b;
char *s;
struct foo *next;
} my_struct;
should work.
If your needs are more complex.. then you should post your non-working example.
EDIT: If you don't have access to CAR then this will suffice for now: http://publications.gbdirect.co.uk/c_book/chapter6/structures.html (obviously not C99)
精彩评论