Re: loop in strucures definition
- From: lawrence.jones@xxxxxxxxxxx
- Date: Thu, 21 Oct 2010 11:26:48 -0400
riccardo <riccardo@xxxxxxxxx> wrote:
typedef struct {
foo2 a;
} foo1;
typedef struct {
foo1 b;
} foo2;
foo2 is not defined yet when used to define foo1.
Placing the foo2 definition before foo1 doesn't help of course.
How can I solve this in a clean way?
Method 1:
typedef struct foo1 {
struct foo2 a;
} foo1;
typedef struct foo2 {
struct foo1 b;
} foo2;
Method 2:
typedef struct foo1 foo1;
typedef struct foo2 foo2;
struct foo1 {
foo2 a;
};
struct foo2 {
foo1 b;
};
--
Larry Jones
Hmph. -- Calvin
.
- Follow-Ups:
- Re: loop in strucures definition
- From: Kenneth Brody
- Re: loop in strucures definition
- From: Ben Bacarisse
- Re: loop in strucures definition
- References:
- loop in strucures definition
- From: riccardo
- loop in strucures definition
- Prev by Date: Re: loop in strucures definition
- Next by Date: Re: If you could change the C or C++ or Java syntax, what would you like different?
- Previous by thread: Re: loop in strucures definition
- Next by thread: Re: loop in strucures definition
- Index(es):
Relevant Pages
|