Typedef variables forward reference problem

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

  1. Yorkie99

    Yorkie99 New Member

    Joined:
    Feb 12, 2008
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    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.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice