storing related structs
- From: Gray Alien <grey@xxxxxxxxxxxxx>
- Date: Sat, 30 Jun 2007 12:28:37 +0100
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.
For compatability with existing libraries, I cannot use a void * (for instance), and cast between struct A and B.
Is there a soln to this problem ?
.
- Follow-Ups:
- Re: storing related structs
- From: Martin Ambuhl
- Re: storing related structs
- From: CBFalconer
- Re: storing related structs
- From: Flash Gordon
- Re: storing related structs
- From: Army1987
- Re: storing related structs
- Prev by Date: Display C in HTML
- Next by Date: [OT] Re: Display C in HTML
- Previous by thread: Display C in HTML
- Next by thread: Re: storing related structs
- Index(es):
Relevant Pages
|