A

Admin • 37.39K Points
Coach

Q. What is the purpose of the 'friend' function in C++?

  • (A) To allow access to private and protected members of a class
  • (B) To create multiple objects of a class
  • (C) To inherit a class
  • (D) To define a global function
  • Correct Answer - Option(A)
  • Views: 112
  • Filed under category C++

Explanation by: Admin
A 'friend' function in C++ can access private and protected members of a class.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.


Question analytics