Multiple choice

With reference to Friend functions, which of the following statements is FALSE?

  1. A friend function can access the private members of the class, outside the class.

  2. A friend function cannot be defined inside the class.

  3. A friend function is a member of the class.

  4. A friend function can be a friend of more the one class.

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Although declared inside the class, a friend function is not a member of the class. Therefore, while calling it, we do not need to use the object name as we do with the class members. A class member is called by using the syntax 

objectname.methodname(); whereas a friend function is called by using the syntax methodname();