an error within context

Posted by helloWorld on Stack Overflow See other posts from Stack Overflow or by helloWorld
Published on 2010-06-17T14:35:33Z Indexed on 2010/06/17 14:43 UTC
Read the original article Hit count: 152

Filed under:

can somebody please explain my mistake, I have this class:

    class Account{
    private:
        string strLastName;     
        string strFirstName;    
        int nID;              
        int nLines;             
        double lastBill;
    public:
        Account(string firstName, string lastName, int id);
    friend string printAccount(string firstName, string lastName, int id, int lines, double lastBill);
}

but when I call it:

string reportAccounts() const {
        string report(printAccountsHeader());
        for(list<Account>::const_iterator i = listOfAccounts.begin(); i != listOfAccounts.end(); ++i){
            report += printAccount(i->strFirstName, i->strLastName, i->nID, i->nLines, i->lastBill);;
        }
        return report;
    }

I receive error within context, can somebody explain why? thanks in advance

© Stack Overflow or respective owner

Related posts about c++