I am new to OOP. I am writing a class (call it ClassA) which needs access to just 1 private member in ClassB. How to I go about doing this? There is concept of friend functions and friend classes which I do not fully understand at this point.
All I want is that there be a function inside ClassA which is private to it and is only used within it, which can read 1 specific private member in ClassB.
Yes, but how do I make it such that only classA can modify this private member of classB and no other class? I mean if I just created a function changevalue(int x) then any class can call this function and change value of this specific private stored inside the classB.