Re: C question about structs
Re: C question about structs
- Subject: Re: C question about structs
- From: "Clark S. Cox III" <email@hidden>
- Date: Mon, 23 Jul 2001 23:31:30 -0400
On Monday, July 23, 2001, at 01:31 , Alex Golovinsky wrote:
Hi, this is a straight C question. I have, say, struct A which includes
struct B and struct B, which has as a member struct A. How do I declare
this without getting undefined types? I was under the impression that I
could do the following:
typedef struct B;
typedef struct
{
B *myb;
}A;
typedef struct
{
A *mya;
}B;
/*I like to keep my typedefs seperate from the actual structure
declaration*/
typedef struct A A;
typedef struct B B;
struct A
{
B *myb;
};
struct B
{
A *mya;
};
however, project builder does not like this.
BTW, it's not project builder that rejects the code, it's the
compiler (gcc).