Q:

Implementation of method in class c++

I'm new in oop and don't know how to specify this problem globally. I have two classes. Client
class Client
{
private:
    int code;
    string name;
public:
    Client(int c, string n);
    int getCode();
    string getName();
};

Client::Client(int c, string n)
{
    this->code = c;
    this->name = n;
}

int Client::getCode()
{
    return this->code;
}

string Client::getName()
{
    return this->name;
}

and Account
class Account
{
private:
    int number;
    double balance;
    double interestRate;
    Client* owner;
  };

and I have method like this:
Client* Account::getOwner()
{
    return this->something;
}

Can you please tell me, how can I get client's code and name from this method?

A:

Can you please tell me, how can I get client's code and name from this method?

The method is called getOwner. A method called getOwner should ... get ... the owner. Nothing else.
If you want to get the owner's name, either write a new method
string getOwnerName() const { return owner->getName(); }

or ...
(better because it reduces coupling between the Account and Client classes, possibly worse because it depends on exposing the owner directly, but then you're already doing that ...)
... just delegate this to the client code:
cout << account->getOwner()->getName();

