#include <iostream>
using namespace std;
int main() {
cout << "Size of bool = " << sizeof(bool) << endl;
cout << "Size of char = " << sizeof(char) << endl;
cout << "Size of short = " << sizeof(short) << endl;
cout << "Size of unsigned short = " << sizeof(unsigned short) << endl;
cout << "Size of int = " << sizeof(int) << endl;
cout << "Size of unsigned int = " << sizeof(unsigned int) << endl;
cout << "Size of long = " << sizeof(long) << endl;
cout << "Size of unsigned long = " << sizeof(unsigned long) << endl;
cout << "Size of float = " << sizeof(float) << endl;
cout << "Size of double = " << sizeof(double) << endl;
cout << "Size of long double = " << sizeof(long double) << endl;
cout << "Size of long long = " << sizeof(long long) << endl;
return 0;
}
C++ 基本数据类型字节数
最新推荐文章于 2024-05-23 18:18:28 发布