ein Fehler "hat kein Element mit dem Namen"

Ich habe dieses snippet des Codes

account.cpp

#include "account.h"
#include <iostream>
#include <string>  

using namespace std;

Account::Account(string firstName, string lastName, int id)
    : strFirstName(firstName), strLastName(lastName), nID(id) {}

void Account::printAccount(){
    cout << strFirstName;
}

Konto.h

#include <string>

using std::string;

class Account{
private:
    string strLastName;      //Client's last name
    string strFirstName;     //Client's first name
    int nID;                //Client's ID number
    int nLines;             //Number of lines related to account
    double lastBill;
public:
    Account(string firstName, string lastName, int id);
        void printAccount();
};

Unternehmen.h

#ifndef CELLULAR_COMPANY_H
#define CELLULAR_COMPANY_H

#include <string>
#include <list>
#include <iostream>
#include "account.h"

using namespace std;

class Company {
private:
    list<Account> listOfAccounts;
public:
    void addAccount(string firstName, string lastName, int id) {
        Account newAccount(firstName, lastName, id);
        listOfAccounts.push_back(newAccount);
    }

    void printAccounts(){
        for(list<Account>::iterator i = listOfAccounts.begin(); i != listOfAccounts.end(); ++i){
            i.printAccount;           //here bug
        }
    }
};


#endif //CELLULAR_COMPANY_H

main.cpp

#include "cellularcompany.h"

int main(){
    Company newCompany;
    newCompany.addAccount("Pavel", "Nedved", 11111);
    newCompany.printAccounts();

    return 0;
}

kann jemand bitte erklären, was mein Fehler bedeutet? vielen Dank im Voraus (ich habe es in der Firma.h siehe Kommentar dort)
Ich habe Fehler 'struct std::_List_iterator<Account>' has no member named 'printAccount'

Die Buchung der vollständige compiler-Fehler ausgegeben werden, helfen uns enorm.
Geben Sie bitte die vollständige Fehlermeldung, die Sie erhalten.
Eventuell unnötige Einsatz von langen Variablen-Namen und die Ungarische notation gemacht, den code weniger lesbar, und so versteckte sich der Fehler von Ihnen?

InformationsquelleAutor helloWorld | 2010-06-17

Schreibe einen Kommentar