Soooooo.......
?Code:account[accountNumber] = new &Loan(accountNumber, accountName,
initialBalance, theInterestRate);
Printable View
Soooooo.......
?Code:account[accountNumber] = new &Loan(accountNumber, accountName,
initialBalance, theInterestRate);
No, that was fine before. See Paul's post for what dereferencing looks like (*p).
Alright so then what exactly am I doing wrong? I'm confused again. If this is my transaction if statement:
And here is my overloaded operator function:Code:else if (transactionType == 't')
{
in >> accountNumber;
in >> theTransactionAmount;
cout << account[accountNumber] << endl;
account[accountNumber]->addTransaction(theTransactionAmount);
cout << "transaction..." << endl
<< account[accountNumber];
}
And this is my virtual addTransaction function for one of my classes:Code:ostream& operator << (ostream &out, const Account &account1)
{
out.setf(ios::fixed);
out.precision(2);
out << dec << account1.initialBalance << endl << endl;
return out;
}
What am I doing wrong?Code:double Savings::addTransaction(double theTransactionAmount)
{
double theInitialBalance = getInitialBalance();
theInitialBalance += theTransactionAmount;
setInitialBalance(theInitialBalance);
}
cout << "transaction..." << endl
<< *(account[accountNumber]);
Ahhhhhh! It worked. Thank you so much. :)
One asterisk has caused me so many problems! Thanks everyone for the help!