What you have there is just a declaration. account(int x, double b); just says that this function exists somewhere. You need a definition, the body of the function.
your right i left that from a previous program, thanks.
but now I am being told i need a default constructor in class account? so i did that and the error went away, I was curious as to why do i need a default constructor along with constructor that does something else?
this is confusing me, i would think
// not to add a default constructor but when i dont i get this error, is my syntax flawed?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
class checking : public account {
public:
double computeIntr(int years) {
//i need balance, but balance is not accessible
}
checking(int acctNum, double balance) {//if i get rid of my default constructor why does it tell me Error: no default constructor for the base class
acctNum = 0;
balance = 0;
}
string toString() {
stringstream ss;
string ans;
ss << " Account Number :" << acctNum << " Balance: " << balance << endl;
ans = ss.str();//the above is now a string
return ans;
}
};