25 lines
378 B
C++
25 lines
378 B
C++
|
// sizeof测试
|
||
|
#include <iostream>
|
||
|
|
||
|
using namespace std;
|
||
|
|
||
|
int main()
|
||
|
{
|
||
|
char c = 'a';
|
||
|
cout << c << endl;
|
||
|
cout << sizeof(c) << endl;
|
||
|
|
||
|
short x = '1';
|
||
|
cout << x << endl;
|
||
|
cout << sizeof(x) << endl;
|
||
|
|
||
|
int z = 1;
|
||
|
cout << z << endl;
|
||
|
cout << sizeof(z) << endl;
|
||
|
|
||
|
bool y = true;
|
||
|
cout << y << endl;
|
||
|
cout << sizeof(y) << endl;
|
||
|
|
||
|
return 0;
|
||
|
}
|