M
Michael B Allen
Consider the following structure with a union:
struct shape {
int type;
union {
struct circle c;
struct square s;
struct polydoodle p;
} u;
};
To access the circle member c one would do:
struct circle *c = &sh.u.c;
But is it legit to access union members through the union rather than
through the arm explicitly like:
struct circle *c = &s.u;
?
Mike
struct shape {
int type;
union {
struct circle c;
struct square s;
struct polydoodle p;
} u;
};
To access the circle member c one would do:
struct circle *c = &sh.u.c;
But is it legit to access union members through the union rather than
through the arm explicitly like:
struct circle *c = &s.u;
?
Mike