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

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.