Re: storing related structs
- From: Martin Ambuhl <mambuhl@xxxxxxxxxxxxx>
- Date: Sat, 30 Jun 2007 13:53:31 -0400
Gray Alien wrote:
I have two related structs:
struct A
{
int x ;
void * data ;
};
and
struct B
{
int x, y ;
double z ;
void * data1, *data2 ;
};
These structures (not pointers to them), need to be stored in a another struct:
struct C
{
unsigned id ;
char name ;
DATA_TYPE the_struct ;
};
Where DATA_TYPE is EITHER a struct A or struct B.
typedef union {
struct A;
struct B;
} DATA_TYPE;
.
- References:
- storing related structs
- From: Gray Alien
- storing related structs
- Prev by Date: Re: compiling c application to prc (palm) tool - TPA
- Next by Date: Re: fscanf hangs
- Previous by thread: Re: storing related structs
- Next by thread: Machine epsilon: conclusion
- Index(es):
Relevant Pages
|