The union declared without tag name is called as- | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

The union declared without tag name is called as-

16th Aug 2017, 4:10 AM
Shwati Kumari
Shwati Kumari - avatar
2 Answers
+ 1
Unions without tagname are called anonymous unions. Members of an anonymous union can be accessed as if they were declared directly in the containing structure or union. For example, given the following structure: struct s { int a; union { int b; float c; }; /* no declarator */ } st; you can make the following statements: st.a = 5; st.b = 36;
17th Aug 2017, 1:36 AM
Abhijeet Jha
Abhijeet Jha - avatar
0
Untagged Unions which does not keep track of which union member is currently in use
16th Aug 2017, 12:24 PM
Sai Krish
Sai Krish - avatar