Mastering C++: 2025 All-In-One Quiz – Ace 'Thinking in C++' with Comprehensive Practice!

Disable ads (and more) with a premium pass for a one time $4.99 payment

Question: 1 / 565

What is true about the friend keyword in C++?

It makes a function a member of a class

It grants an outside function access to the class's private members

The friend keyword in C++ is used to grant access to private members of a class to functions and other classes. Option A is incorrect as making a function a member of a class is done using the keyword "member". Option C is incorrect as declaring a new class is done using the keyword "class". Option D is incorrect as inheritance in C++ is done using the keyword "inherit". Therefore, the correct answer is option B.

Get further explanation with Examzify DeepDiveBeta

It declares a new class

It is used to inherit from another class

Next

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy