c++
Lnk112
LNK200
为什么会产生报错,如何解决
#include <iostream>
using namespace std;
class Student {
private:
static int count;
char name;
public:
static void getCount(int judge);
Student() {
cout << "请输入学生姓名";
cin >> name;
getCount(1);
}
~Student() {
cout << "该生信息已删除";
getCount(0);
}
};
int main() {
Student a, b;
return 0;
}
void Student::getCount(int judge){
if (judge)
count++;
else
count--;
cout << "共有学生" << count << "名";
}