0
点赞
收藏
分享

微信扫一扫

写一个程序,输出在你使用的C++系统中int类型的数据占几个字节,double类型的 数据占几个字节,short int占几个字节,float类型占几个字节。

#include <iostream>
using namespace std;

int main() {
	cout << "int:" << sizeof(int) << endl;
	cout << "double:" << sizeof(double) << endl;
	cout << "float:" << sizeof(float) << endl;
	cout << "short int:" << sizeof(short int) << endl;
}

在这里插入图片描述

举报

相关推荐

0 条评论