Practice mode C++

Which C++ keyword gives a non-member function access to the private members of a class?

Correct answer B. friend

Explanation

A function declared as a friend inside a class can access that class's private and protected members, even though it is not a member.

Report a problem

Answer checked How we write and check questions

Tip: press A, B, C or D to answer, and N for the next question.

Advertisement

Have a question about this answer?

Your email address will not be published. Required fields are marked *

Links and website addresses are not allowed in comments.