please fix this programme
please fix this programme
Code:
#include <iostream.h>
#include <iomanip.h>
union u_student
{
short int number;
int phone;
};
struct s_student
{
short int number;
int phone;
};
void main()
{
u_student A;
s_student B;
A.phone = 0x00000000;
A.phone = 0x11223344;
A.number = 0x5555;
B.phone = 0x00000000;
B.phone = 0x11223344;
B.number = 0x5555;
cout.setf(ios::hex,ios::basefield);
cout <<"A.phone ="<<A.phone <<"\n";
cout <<"A.number = "<<A.number <<"\n";
cout <<"B.phone ="<<B.phone <<"\n";
cout <<"B.number ="<<B.number <<"\n";
return 0;
}