There's a reason this doesn't work, I suspect:
Declaring a MyStruct2 creates a MyStruct1, which creates a MyStruct2, which
creates MyStruct1, which creates a...
How could that ever work? I really do not think it's possible with any given
amount of memory.
Please correct me if I'm wrong, but I can't see this ever being possible.
-----Original Message-----
From: dev...@li...
[mailto:dev...@li...]On Behalf Of Farzan
Hajian
Sent: Friday, March 11, 2005 12:25 PM
To: dev...@li...
Subject: [Dev-C++] Problem with structs
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
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
says "`s2' has incomplete type"
Now how can I solve this??
Thanks,
--
Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
_______________________________________________
Dev-cpp-users mailing list
Dev...@li...
TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
___________________________________________________________________
The information contained in this message and any attachment may be
proprietary, confidential, and privileged or subject to the work
product doctrine and thus protected from disclosure. If the reader
of this message is not the intended recipient, or an employee or
agent responsible for delivering this message to the intended
recipient, you are hereby notified that any dissemination,
distribution or copying of this communication is strictly prohibited.
If you have received this communication in error, please notify me
immediately by replying to this message and deleting it and all
copies and backups thereof. Thank you.
|