Technical Discussion :: C++
Home > Technical Interview Q&A > C++ > Discussion
6 / 187
What are limitations of union?
Answer:
This means if one member variable of union is updated then the rest will be updated as well. This also leads compilation error when initializing multiple members at a time as the memory locations are not different. So in case of union only one member should be initialized at a time.
Asked In ::
Varun Kumar Rai
23 Feb, 2019 5:07 AM
This means if one member variable of union is updated then the rest will be updated as well. This also leads compilation error when initializing multiple members at a time as the memory locations are not different. So in case of union only one member should be initialized at a time.