W
wim delvaux
Hi all,
I want to initialize two structures with pointers
to eachother
static StructA VarA = { PtrToVarB };
static StructB VarB = { PtrToVarA };
A solution that WORKS in C (using gcc 3.3) is
static StructA VarA; // defining VarA
static StructB VarB; // defining VarB
and then
static StructA VarA = { &VarB };
static StructB VarB = { &VarA };
However in C++ (same gcc version) it does not work because
the first static is not assumed to be tentative.
How can I solve this problem ? Initializing using
functions is not possible since the above code is
generated automatically by some compiler
W
I want to initialize two structures with pointers
to eachother
static StructA VarA = { PtrToVarB };
static StructB VarB = { PtrToVarA };
A solution that WORKS in C (using gcc 3.3) is
static StructA VarA; // defining VarA
static StructB VarB; // defining VarB
and then
static StructA VarA = { &VarB };
static StructB VarB = { &VarA };
However in C++ (same gcc version) it does not work because
the first static is not assumed to be tentative.
How can I solve this problem ? Initializing using
functions is not possible since the above code is
generated automatically by some compiler
W