typedef struct x
{
struct x y *z1
struct x y *z2
} sdf
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
Posted: Thu Jan 24, 2008 11:49 am
It probably doesn't work, but if you want us to test it, you need to
post code that is compilable on at least some compiler (like MSVC).
Your current code is not compilable.
Wayne_
Joined: 10 Oct 2007 Posts: 681
Posted: Fri Jan 25, 2008 2:10 am
First of all your code is flawed.
You are missing commas and a semicolons.
You are also redefining y.
Now the problem is it will take up infinate space as when you create the structure (The sdf at the end does this) it then goes on to reserve memory for itself and within that you create another version of itself, the struct x y, *Z1; does this. The pointer is OK but the struct x y actually reserves memory for a new structure and calls it y (sdf.y). This in turn creates another structure of type x with a struct y in it (sdf.y.y) and so on and so on (sdf.y.y.y.y.y.y.y.y.y......).
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum