#include<climits>
int main()
{
using namespace std;
int n_int=INT_MAX;
short n_short=SHRT_MAX;
long n_long=LONG_MAX;
long long n_llong=LLONG_MAX;
// float is 4 bytes.
// double is 8 bytes.
cout<<"char is "<<sizeof(char)<<" bytes."<<endl;
cout<<"unsigned char is "<<sizeof(unsigned char)<<" bytes."<<endl;
cout<<"short is "<<sizeof n_short<<" bytes."<<endl;
cout<<"unsigned short is "<<sizeof(unsigned short)<<" bytes."<<endl;
cout<<"int is "<<sizeof(int)<<" bytes."<<endl;
cout<<"unsigned is "<<sizeof(unsigned)<<" bytes."<<endl;
cout<<"long is "<<sizeof n_long<<" bytes."<<endl;
cout<<"long long is
C++数据类型/大小
最新推荐文章于 2024-03-03 10:51:23 发布
本文探讨了在Ubuntu操作系统中,不同C++数据类型的内存占用大小。通过实例展示了char, int, float, double等基本数据类型的字节大小,并讨论了这些大小可能对程序性能和内存使用的影响。"
8495500,1386657,Oracle数据库身份认证方式详解,"['数据库管理', 'Oracle认证', '操作系统认证', '身份验证', '数据库安全']
摘要由CSDN通过智能技术生成