/*
练习4.28:
编写程序,输出每一种内置类型所占空间的大小。
答:
内置类型包括算术类型和空类型。
算术类型包括整型和浮点型:
bool、char、wchar_t、char16_t、char32_t、short、
int、long、long long、float、double、long double
*/
#include "TouWenJian_4.h"
int main()
{
cout<<"1、bool size of bytes : \t\t"<<sizeof(bool)<<" bytes"<<endl<<endl;
cout<<"2、char size of bytes : \t\t"<<sizeof(char)<<" bytes"<<endl<<endl;
cout<<"3、wchar_t size of bytes : \t\t"<<sizeof(wchar_t)<<" bytes"<<endl<<endl;
cout<<"4、char16_t size of bytes : \t\t"<<sizeof(char16_t)<<" bytes"<<endl<<endl;
cout<<"5、char32_t size of bytes : \t\t"<<sizeof(char32_t)<<" bytes"<<endl<<endl;
cout<<"6、short size of bytes : \t\t"<<sizeof(short)<<" bytes"<<endl<<endl;
cout<<"7、int size of bytes : \t\t\t"<<sizeof(int)<<" bytes"<<endl<<endl;
cout<<"8、long size of bytes : \t\t"<<sizeof(long)<<" bytes"<<endl<<endl;
cout<<"9、long long size of bytes : \t\t"<<sizeof(long long)<<" bytes"<<endl<<endl;
cout<<"10、float size of bytes : \t\t"<<sizeof(float)<<" bytes"<<endl<<endl;
cout<<"11、double size of bytes : \t\t"<<sizeof(double)<<" bytes"<<endl<<endl;
cout<<"12、long double size of bytes : \t"<<sizeof(long double)<<" bytes"<<endl<<endl;
return 0;
}