Anonymous Union
suggest changeThe members of an anonymous union belong to the scope containing the union declaration and must not conflict with other names in that scope. This construction resembles the struct in Anonymous Members, but is standard-conforming.
struct Sample {
union {
int a;
int b;
};
int c;
};
int main()
{
Sample sa;
sa.a =3;
sa.b =4;
sa.c =5;
}
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents