Classes And Objects In C Plus Plus - Study Mode

[#111] Which keyword is used to declare a class in C++?
Correct Answer

(C) class

[#112] What is the purpose of the static member variable in C++?
Correct Answer

(D) To maintain common data for all objects

[#113] Which operator is used to access members of a class through a pointer in C++?
Correct Answer

(A) Arrow operator (->)

[#114] What is the purpose of using friend functions in C++?
Correct Answer

(C) To allow access to private and protected members of a class from outside the class

[#115] Which access specifier allows members of a class to be accessed only by the derived classes in C++?
Correct Answer

(B) protected