加入在student.h文件中定义了一个类Student以及这个类的静态成员变量
age
class Student
{
static int age;
}
如果不在student.cpp文件中做静态声明,则编译不通过
student.cpp中
int Student::age;
转载于:https://blog.51cto.com/479284883/1395695
加入在student.h文件中定义了一个类Student以及这个类的静态成员变量
age
class Student
{
static int age;
}
如果不在student.cpp文件中做静态声明,则编译不通过
student.cpp中
int Student::age;
转载于:https://blog.51cto.com/479284883/1395695