tags:

views:

86

answers:

2

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.

A: 

You should provide some code and error message, given by gcc for this code.

As far as I know, gcc conforms C standards.

this would be better as a comment than an answer.
Philip Potter
+1  A: 

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)

Sint