Multiple choice

Which of the following members is NOT accessible through a 'Friend Function'?

  1. Public member of a class

  2. Private member of a class

  3. Protected member of a class

  4. Members of the child class

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

A friend function can only access the members of the class of which it is a friend. It does not have the power of accessing child class members. In inheritance, the derived class can access the members of the parent class, not the other way around.