.

You seem to be giving little details over time.
There is not enough information available so we can't help you.
I'm trying to read my class file and print it out on my main function,

I get an error saying,

in function 'void account_info(const BankAccount*, int, std::ofstream&, std::ifstream&):
error: request for member 'getFirstname' in 'account', which is of pointer type 'const BankAccount*' (maybe you meant to use '->' ?)

same error for the others

my error starts from,

cout << endl << "The First and Last name is: " << account.getFirstname();
cout << " " << account.getLastname();
cout << endl << "The Account number is: " << account.getAcctNum();
cout << endl << "The Account Type is: " << account.getAcctType();
cout << endl << "The current balance of this account is: " << account.getAcctBalance();

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
 void account_info(const BankAccount account[], int num_accts, ofstream &outfile, ifstream &cin)
{
    string ssnum;
    int found = 0;
    int index;

    cout << endl << "Enter the person's Social Security Number: ";
    cin >> ssnum;

    outfile << endl << "\n\nTransaction Requested: Account Information" << endl;
    outfile << "Enter Person's Social Security Number: " << ssnum << endl;
    for(index = 0; index < num_accts; index++)
        if(account[index].FindSSN(ssnum))
            found++;
        if(!found)
            cout << "The Person's Social Security Number you just input " << ssnum << " is invalid\n";
        else
            cout << endl << "The First and Last name is: " << account.getFirstname();
            cout << " " << account.getLastname();
            cout << endl << "The Account number is: " << account.getAcctNum();
            cout << endl << "The Account Type is: " << account.getAcctType();
            cout << endl << "The current balance of this account is: " << account.getAcctBalance();
    return;
}



Don't forget that account is an array, not a single instance of your BankAccount. You need to tell the compiler which element of the array you want use to print the information.
Topic archived. No new replies allowed.