CPP Program to implement union

Source Code : 

#include<iostream>
#include<stdio.h>
using namespace std;
union test
{
int x;
char y[5];
int z;
}t1;
int main()
{
cout<<"Size = "<<sizeof(t1);
return 0;
}

Program Output : 


Post a Comment

0 Comments