win32位 x86
cout << sizeof(short) << endl; cout << sizeof(int) << endl; cout << sizeof(long) << endl; cout << sizeof(long long) << endl; cout << sizeof(float) << endl; cout << sizeof(double) << endl; cout << sizeof(long double) << endl; cout << sizeof(char) << endl; cout << sizeof(int *) << endl; cout << sizeof(float *) << endl; cout << sizeof(int[1]) << endl; cout << sizeof(int[2]) << endl; cout << sizeof(float[2]) << endl;
结果:
2 4 4 8 4 8 8 1 4 4 4 8 8
win64位 x64
cout << sizeof(short) << endl; cout << sizeof(int) << endl; cout << sizeof(long) << endl; cout << sizeof(long long) << endl; cout << sizeof(float) << endl; cout << sizeof(double) << endl; cout << sizeof(long double) << endl; cout << sizeof(char) << endl; cout << sizeof(int *) << endl; cout << sizeof(float *) << endl; cout << sizeof(int[1]) << endl; cout << sizeof(int[2]) << endl; cout << sizeof(float[2]) << endl;
结果:
2 4 4 8 4 8 8 1 8 8 4 8 8



