Initialization

Lars Berntzon lab at spader.UUCP
Thu Oct 4 05:30:15 AEST 1990


Hello!
My problem is that i want to initialize two types of struct variables with
the address of the opposit struct.
What i want to do is:
{
    struct a {
        struct b *b;
        variable
           .
           .
    };

    struct b {
        struct a *a;
        other variables
           .
           .
    };

    static a = {&b, data ...};
    static b = {&a, other data...};
}

I thought of declaring the two structs as extern, but i need (would like) to
have them as static beccause in my application there arent just two structs
but hundreds. Is there any similar way for static declarations as for extern
declarations (ie. declaring, not defining static variables), or is there any
other way to do this initialization ?
Any suggestions how this could be done would be apprecciated.


--------------------------------------------------------------------------------
Lars Berntzon				UUCP: mcsun!sunic!spader!lab
CGL Techno
Danmarksg. 46
Sweden



More information about the Comp.lang.c mailing list