class Student{
static Student s;
//Student ss;//错误,不允许使用不完整类型
Student *sss;//不完整类型可以是指针或引用
Student &ssss;
};
静态成员的初始化问题
class Example{
public:
static double rate = 6.5;//错误,静态成员不能在类中初始化
static const int v = 10;//正确,只有整型静态常量才能在类中初始化
int i = 10;//最好不要这样做
static const double x = 1.0;//错误,只有整型静态常量才能在类中初始化
}