📄 ex11-04.cpp
字号:
//EX11-04.cpp
#include <iostream.h> //cout,cin
#include <conio.h> // getch()
union u_type
{ float r;
char ch;
short n;
}u;
void main()
{
cout << "Total bytes="
<< sizeof(u_type)
<<"\n r has:"<<sizeof(u.r)
<<"\n ch has:"<<sizeof(u.ch)
<<"\n n has:"<<sizeof(u.n);
getch();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -