VS常用类型及其指针内存
作者:互联网
int main()
{
cout << sizeof(char) << endl ;
cout << sizeof(char*)<< endl;
cout << sizeof(int) << endl;
cout << sizeof(int*) << endl;
cout << sizeof(short) << endl;
cout << sizeof(short*) << endl;
cout << sizeof(long) << endl;
cout << sizeof(long*) << endl;
cout << sizeof(double) << endl;
cout << sizeof(double*) << endl;
cout << sizeof(float) << endl;
cout << sizeof(float*) << endl;
}
输出
1
4
4
4
2
4
4
4
8
4
4
4
![](https://g.csdnimg.cn/static/user-reg-year/1x/2.png)
标签:私信,cout,int,苞米,VS,内存,文章,获赞,指针 来源: https://blog.csdn.net/weixin_42709632/article/details/104610853