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

Question: 1 / 565

How can you access a base class function from a derived class when both classes have functions with the same name?

Using the scope resolution operator

You can access a base class function from a derived class by using the scope resolution operator (:). This allows you to specify which class's function you want to use. Renaming the base class function is not necessary as long as you use the scope resolution operator. Only calling the derived class function will not give you access to the base class function. It is possible to access base class functions from a derived class, as long as you use the proper syntax. The correct way to do so is by using the scope resolution operator.

Get further explanation with Examzify DeepDiveBeta

By renaming the base class function

By calling the derived class function only

It is not possible

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy