1
我有一些定义我的班级里面的问题:成员函数的类构造函数中调用
class Test{
protected:
int a;
int *b;
Teste() {}
public:
int getA() {return a;}
int getB() {if (b) return *b; else return 0;}
bool isB() {if(b) return true; else return false;}
Test(int a1, int b1): a(a1) {b = new int(b1);}
Test(const Test& test) {
if (test.isB())
this->b = new int(test.getB());
this->a = test.getA();
}
};
我收到以下错误信息:
“无效参数‘考生布尔ISB()’”
和
“无效参数 '考生布尔getB()'”
问题是什么?
谢谢你在前进,