正如标题所说,我在子类构造函数中调用基类构造函数时遇到了一些问题
根据:
account.h
Account(double, Customer*)
account.cpp
Account::Account(double b, Customer *cu)
{
balance = b;
cust = *cu;
}
子类:
savings.h
Savings(double);
savings.cpp
Savings::Savings(double intRate) : Account(b, cu)
{
interestRate = intRate;
}
我得到的错误是 b 和 cu 未定义。感谢帮助