1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Typedef variables forward reference problem

Discussion in 'C' started by Yorkie99, Feb 12, 2008.

  1. Yorkie99

    Yorkie99 New Member

    Feb 12, 2008
    Likes Received:
    Trophy Points:
    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;

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

    typedef struct s3_tag
    s1 a;
    s2 b;


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

Share This Page