/*
data: 2017/06/28
environment: codeBlocks16.01
author: joker
function: output the size of different data_type
*/
#include <iostream>
using namespace std;
int main()
{
cout << "type" << "\t\t" << "size(Byte)"<< endl;
cout << endl;
for(int i=1;i <= 28;i++) {cout << '-' ;} cout << endl;
cout << "基本类型" << endl;
cout << "int " << "\t\t" << sizeof(int)<< endl;
cout << "short int " << "\t" << sizeof(short int)<< endl;
cout << "long int " << "\t" << sizeof(long int)<< endl;
cout << "float " << "\t\t" << sizeof(float)<< endl;
cout << "double " << "\t\t" << sizeof(double)<< endl;
cout << "long double " << "\t" << sizeof(long double)<< endl;
cout << "bool " << "\t\t" << sizeof(bool)<< endl;
for(int i=1;i <= 28;i++) {cout << '-' ;} cout << endl;
cout << "派生类型" << endl;
cout << endl;
cout << "待补充" <<endl;
for(int i=1;i <= 28;i++) {cout << '-' ;} cout << endl;
cout << "待补充" <<endl;
return 0;
}
C++的数据类型--新手入门笔记
最新推荐文章于 2024-02-18 15:09:05 发布