union in C++
In C++. A union is defined starting with the keyword union, followed by an (optional) name for the union and a set of member declarations enclosed in curly braces. * A union type can't have a base class. ``` #include <iostream> using namespace std; union Token { char cval; int ival; double dval; }; int main() { Token t; t.cval = 1; cout << t.ival << endl; } ```