🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Operators and Templates: all 10 questions

Quiz: Operators and Templates · Question 10 of 10

What does a friend function of a class get that an ordinary function does not?

What does a friend function of a class get that an ordinary function does not?

  1. A.It becomes a member function
  2. B.It is inherited by derived classes
  3. C.Access to the class's private and protected members
  4. D.A this pointer
Answer & explanation

Correct answer: Access to the class's private and protected members

A friend is still a non-member function; it simply has permission to read private data.

Can you get the rest right without peeking?

Take the timed Quiz: Operators and Templates quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →