C++ 整型字节

表示整数、字符和布尔值的算术类型合称为整型(integraltype)

 整型int、short和long都默认为带符号型。要获得无符号类型必须指定该类型为unsigned,比如unsigned long。

unsignedint类型可以简写为unsigned,也就是说,unsigned后不加其他类型说明符就意味着是unsignedint。

一字节表示八位,即:1byte =8 bit;

 int                        4byte  32 bit 

signed                  4byte   32 bit  2^31-1 ~ -2^31   即:2147483647 ~-2147483648

unsigned              4byte  32 bit     0   ~ 2^32-1  即:   0     ~ 4294967295

long                      4byte   32bit 

double                  8byte   64 bit  1.79769e+308  ~2.22507e-308

long double          12byte  96bit   1.18973e+4932 ~ 3.3621e-4932

float                       4byte   32bit   3.40282e+038  ~1.17549e-038

猜你喜欢

转载自blog.csdn.net/Lost_the_wind/article/details/84248451