Just a little help for friend method class ???

I dont know if this is possible:

I have :

1
2
3
4
5
 ClassA  
    public :    
      void methodA
    private :     
      ClassB my_classb



1
2
   ClassB
      void methodB


Look at ClassA
I have my_classb.methodB; working well.

Now I'd want to have acces to methodA from methodB.
That is to say I'd want to can execute
1
2
3
4
5
6
 void ClassB::methodB
{

   if (condition)
   classB.methodA ();
}


Of course I dont want to see any more methods from classA, only the marked to this purpose.


I think that what I what can be easy but I dont understand the reference I have seen.
Any help ? Thanks:


Last edited on
methodA operates on instances of type ClassA. ClassB is not a ClassA, so you can't call it on an instance of ClassB.
Topic archived. No new replies allowed.