The friendship granted by a class A to a function or class B is _______ reciprocal, meaning [choose the correct statement]. 

  • always 
  • occasionally 
  • one-way 
  • not
The friendship in C++ is one-way. If class A declares class B or a function as its friend, it doesn't mean that class A automatically becomes a friend of class B or that function. Friendship must be explicitly granted. This means the granting of friendship is not reciprocal by default. Class B or the function would need to separately declare class A as a friend for the reverse to be true.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *