Hi friends,
I want to declare two structures like this:
struct MyStruct1
{
int i;
MyStruct2 s2;
};
struct MyStruct2
{
float f;
MyStruct1 s1;
};
but there is a compiler error says "'MyStruct2' is used as a type, but is=
=20
not defined as a type."
Then I declare MyStruct2 before MyStruct1 as below:
struct MyStruct2; // Declaring MyStruct2
struct MyStruct1
{
int i;
MyStruct2 s2; // **** Causes error *****
};
struct MyStruct2
{
float f;
MyStruct1 s1;
};
but now there is an another error refers to the line "MyStruct2 s2;" and=
=20
says "`s2' has incomplete type"
Now how can I solve this??
Thanks,
--=20
Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
|