← 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?
- A.It becomes a member function
- B.It is inherited by derived classes
- C.Access to the class's private and protected members
- 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 →