Union of same type in C++

后端 未结 3 1862
一向
一向 2021-01-17 23:06

Whenever I see examples of union, they are always different types. For example, from MSDN:

// declaring_a_union.cpp
union DATATYPE    // Declare union type
{         


        
3条回答
  •  臣服心动
    2021-01-17 23:44

    An issue would arise only if you want to have unique values for the two variables. In your use-case, it should work fine.

提交回复
热议问题