C++中各种基本数据类型大小一览

更新时间:2023-07-10 02:54:17 阅读: 评论:0

C++中各种基本数据类型⼤⼩⼀览  109**以下⽤`int`,**1018以下⽤ long long 。
  C++代码如下
#include<iostream>
#include<string>
#include <limits>
using namespace std;
int main()
{
cout << "type: \t\t\t" << "************size**************" << endl;
cout << "bool: \t\t\t" << "numOfBytes:" << sizeof(bool);优美作文800字
cout << "\t\tmaxValue:" << (numeric_limits<bool>::max)();
cout << "\t\t\t\tminValue:" << (numeric_limits<bool>::min)() << endl;
cout << "char: \t\t\t" << "numOfBytes:" << sizeof(char);
cout << "\t\tmaxValue:" << (numeric_limits<char>::max)();
cout << "\t\t\t\tminValue:" << (numeric_limits<char>::min)() << endl;
cout << "signed char: \t\t" << "numOfBytes:" << sizeof(signed char);
cout << "\t\tmaxValue:" << (numeric_limits<signed char>::max)();怀孕可以吃黄鳝吗
cout << "\t\t\t\tminValue:" << (numeric_limits<signed char>::min)() << endl;
cout << "unsigned char: \t\t" << "numOfBytes:" << sizeof(unsigned char);
cout << "\t\tmaxValue:" << (numeric_limits<unsigned char>::max)();气魄的近义词
cout << "\t\t\t\tminValue:" << (numeric_limits<unsigned char>::min)() << endl;
cout << "wchar_t: \t\t" << "numOfBytes:" << sizeof(wchar_t);
20个拟声词
cout << "\t\tmaxValue:" << (numeric_limits<wchar_t>::max)();
cout << "\t\t\t\tminValue:" << (numeric_limits<wchar_t>::min)() << endl;
cout << "short: \t\t\t" << "numOfBytes:" << sizeof(short);
cout << "\t\tmaxValue:" << (numeric_limits<short>::max)();
cout << "\t\t\t\tminValue:" << (numeric_limits<short>::min)() << endl;
cout << "int: \t\t\t" << "numOfBytes:" << sizeof(int);
cout << "\t\tmaxValue:" << (numeric_limits<int>::max)();空气净化器排名
cout << "\t\t\tminValue:" << (numeric_limits<int>::min)() << endl;
cout << "unsigned: \t\t" << "numOfBytes:" << sizeof(unsigned);
cout << "\t\tmaxValue:" << (numeric_limits<unsigned>::max)();
cout << "\t\t\tminValue:" << (numeric_limits<unsigned>::min)() << endl;
cout << "long: \t\t\t" << "numOfBytes:" << sizeof(long);
cout << "\t\tmaxValue:" << (numeric_limits<long>::max)();
cout << "\t\t\tminValue:" << (numeric_limits<long>::min)() << endl;
cout << "long long: \t\t" << "numOfBytes:" << sizeof(long long);
cout << "\t\tmaxValue:" << (numeric_limits<long long>::max)();
儿童诗创作
cout << "\t\tminValue:" << (numeric_limits<long long>::min)() << endl;
cout << "unsigned long: \t\t" << "numOfBytes:" << sizeof(unsigned long);
cout << "\t\tmaxValue:" << (numeric_limits<unsigned long>::max)();
cout << "\t\t\tminValue:" << (numeric_limits<unsigned long>::min)() << endl;
cout << "double: \t\t" << "numOfBytes:" << sizeof(double);
cout << "\t\tmaxValue:" << (numeric_limits<double>::max)();
cout << "\t\t\tminValue:" << (numeric_limits<double>::min)() << endl;
cout << "long double: \t\t" << "numOfBytes:" << sizeof(long double);
cout << "\t\tmaxValue:" << (numeric_limits<long double>::max)();
cout << "\t\t\tminValue:" << (numeric_limits<long double>::min)() << endl;
cout << "float: \t\t\t" << "numOfBytes:" << sizeof(float);
cout << "\t\tmaxValue:" << (numeric_limits<float>::max)();
cout << "\t\t\tminValue:" << (numeric_limits<float>::min)() << endl;
cout << "size_t: \t\t" << "numOfBytes:" << sizeof(size_t);
cout << "\t\tmaxValue:" << (numeric_limits<size_t>::max)();
锲而不舍的拼音cout << "\t\tminValue:" << (numeric_limits<size_t>::min)() << endl;    cout << "\t\t\t" << "************size**************" << endl;
return 0;
}
牛肉汤的家常做法

本文发布于:2023-07-10 02:54:17,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/89/1075180.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:空气   数据类型   黄鳝   近义词   创作
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图