// union example 1
#include <iostream>
using namespace std;
union Number
{
int i;
double d;
};
int main()
{
Number n;
n.i = 7;
cout << n.i << endl;
n.d = 4.6;
cout << n.d << endl;
cout << n.i << endl;
cout << sizeof(n) << endl;
}
****** OUTPUT ******
7
4.6
1717986918
8