static在类中的定义,和enum的用法
摘要:class A { // static int a = 1;//错误,静态变量在类外定义 static int a; static const int b = 1;//如果是静态成员常量,则可以在类内定义 static const int c;//也可以在外面定义 }; int A::a = 1;//类外定义静态成员变量; const int A::c = 1;//在外面定义的静态成员常量...
阅读全文
posted @ 2016-06-13 17:26
浙公网安备 33010602011771号