I have two structures:
Code:
struct something {
char id;
char data[100];
};
struct somethingelse {
char name;
char data[100];
};
Without using a union, could I make these two structures as one? I had even thought to make it something like
Code:
struct something {
char id_or_name;
char data[100];
};
but that is so ugly. I haven't tried it (but will), but would this be valid (and the best way to do this):
Code:
#define name id
struct something {
char id;
char data[100];
};
struct something stuff;
struct something name;
stuff.id = 3;
name.name = 'j';