#include "stdafx.h"
#include <iostream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
cout<<"类型type/t/t/t"<<"大小size"<<endl;
cout<<"bool /t/t/t"<<sizeof(bool)<<endl;
cout<<"char /t/t/t"<<sizeof(char)<<endl;
cout<<"signed char/t/t/t"<<sizeof(signed char)<<endl;
cout<<"unsigned char /t/t/t"<<sizeof(unsigned char)<<endl;
cout<<"wchar_t /t/t/t"<<sizeof(wchar_t)<<endl;
cout<<"short /t/t/t"<<sizeof(short)<<endl;
cout<<"signed short/t/t/t"<<sizeof(signed short)<<endl;
cout<<"int /t/t/t/t"<<sizeof(int)<<endl;
cout<<"signed int/t/t/t"<<sizeof(signed int)<<endl;
cout<<"unsigned int /t/t/t"<<sizeof(unsigned int)<<endl;
cout<<"long /t/t/t"<<sizeof(long)<<endl;
cout<<"signed long /t/t/t"<<sizeof(signed long)<<endl;
cout<<"float /t/t/t"<<sizeof(float)<<endl;
cout<<"double /t/t/t"<<sizeof(double)<<endl;
cout<<"long double/t/t/t"<<sizeof(long double)<<endl;
return 0;
}
运行结果:
C++中的类型大小
最新推荐文章于 2024-01-15 10:27:30 发布