Menu

Custom Search

C++ lab Program

#include
#include
union u_intflo
{
int intnum;
float floatnum;
};
struct s_intflo
{
int intnum;
float floatnum;
};
int main()
{
u_intflo unionex;
s_intflo structex;
clrscr();
cout<<"sizeof unionex="< cout<<"sizeof structex="< getch();
return 0;
}
/* out put
sizeof unionex= 4
sizeof structex =6
*/

No comments:

Post a Comment