0

so the assignment I have is for a bank login program. and the function looks like so
Client* Bank::login()

based off a boolean value this bank command(which has a private: client* to an array of clients)
I have to return a pointer to the correct client or NULL.

so simplified I have

Client* Bank::login()
{ 

Ask for login infor;

attempt successful login;

if (login successful)

//ERROR SOMEWHERE// IN HERE 

client* pointerClient;
pointerClient = client[correctclient] 
return  pointerClient                 

else 
return NULL

}

and here is the call function in main

int main()
{   Client *client = NULL;
    //Create and open the bank
    Bank bank("testBank");
    bank.open;

    //preform transactions for a valid client login
    client = bank.login();
    if (client)
        bank.preformTransactions(client);

    //clean up
    bank.close();

    return 0;

}

I can't figure out what return type to have, nothing i've tried works

2
Contributors
1
Reply
2
Views
4 Years
Discussion Span
Last Post by Moschops
0

The only issue I can see is that sometimes you use the type client and sometimes you use Client. C++ is case-sensitive. It should be returned a pointer to Client.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.