Here are two classes
class A{
A(int val):Val(val){}
int getVal(){return Val;}
friend class B;
private:
int Val;
}
class B{
B(A* ptr):PTR(ptr){}
private:
A* PTR;
}
In the main function I create the objects for both classes
A objA;
B objB(&objA)
As you can see, objB now contains a pointer to the address of objA. The problem I am facing is how do I use a pointer from objB to access to member function in objA.