// Ex530.cc // Sec. 5.3 of lecture // Union #include main() { // new union union operand { int i; float f; double d; }; // Variable of union type operand u; // Data input cout << endl << "Size (operand) : " << sizeof(u) << " Bytes" << endl; u.i = 123; cout << endl << u.i << " " << u.f << " " << u.d << endl; u.f = 123; cout << endl << u.i << " " << u.f << " " << u.d << endl; u.d = 123; cout << endl << u.i << " " << u.f << " " << u.d << endl; }