Mastering C++: A Comprehensive Quiz Based on 'Thinking in C++'

Question: 1 / 50

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.

It declares a new class

It is used to inherit from another class