Re: storing related structs
- From: Chris Dollin <eh@xxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 30 Jun 2007 13:15:18 GMT
Grey Alien wrote:
Army1987 wrote:
<snip></snip>
struct C {Why have you declared an enum here? ^ (can't see why this is needed)
unsigned id;
char name; /* do you mean *name, or name[LARGE_ENOUGH]? */
enum { strA, strB } type;
So you can record whether this union ...
union {
struct A str_A;
struct B str_B;
} the_struct;
.... is currently supposed to be an A or a B.
};
As far as solutions go, I think we don't know what problem
you're trying to solve, only the C context you're trying
to solve it in. It may make a difference.
--
Pressure Hedgehog
The "good old days" used to be much better.
.
- References:
- storing related structs
- From: Gray Alien
- Re: storing related structs
- From: Army1987
- Re: storing related structs
- From: Grey Alien
- storing related structs
- Prev by Date: Re: storing related structs
- Next by Date: Re: storing related structs
- Previous by thread: Re: storing related structs
- Next by thread: Re: storing related structs
- Index(es):
Relevant Pages
|