C++类有几种类型的数据成员:普通类型.常量(const).静态(static).静态常量(static const).这里分别探讨以下他们在C++11之前和之后的初始化方式. c++11之前版本的初始化 在C++11之前常规的数据成员变量只能在构造函数里和初始化列表里进行初始化.const类型的成员变量只能在初始化列表里并且必须在这里进行初始化.static类型只能在类外进行初始化.static const类型除了整型数可以在类内初始化,其他的只能在类外初始化.代码如下: class A {
pecific integral type limits Specifier Common Equivalent Signing Bits Bytes Minimum Value Maximum Value int8_t signed char Signed 8 1 −128 127 uint8_t unsigned char Unsigned 8 1 0 255 int16_t short Signed 16 2 −32,768 32,767 uint16_t unsigned short U