Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   Typedef variables forward reference problem (http://www.go4expert.com/forums/typedef-variables-forward-reference-t8788/)

Yorkie99 12Feb2008 22:01

Typedef variables forward reference problem
 
Ok, this should be a fairly simple problem to solve but I'm obviously being thick !!

How do I get the following code to compile ?

typedef struct s1_tag
{
int a;
s2 b;
}s1;

typedef struct s2_tag
{
int a;
int b;
}s2 ;

typedef struct s3_tag
{
s1 a;
s2 b;

}s3;


I know I have to provide forward refs, but I just can't work out how to do it with typedef'd structures.


All times are GMT +5.5. The time now is 17:30.