一阶段:c++学习代码保存
B站学习练习代码
2.1整型
#include <iostream>
using namespace std;
int main2_1()
{
short a = 1;
cout << sizeof(a)<<sizeof(long);
system("pause");
return 0;
}
#2.2 sizeof关键字
#include <iostream>
using namespace std;
int main2_2()
{
cout << sizeof(int)<<endl;
cout<<sizeof(short)<<endl;
cout<<sizeof(long)<<endl;
cout<<sizeof(long long)<<endl;
system("pause");
return 0;
}