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

Question: 1 / 565

What happens when you redefine a member function of a base class in a derived class?

The derived class function overloads the base class function

The base class function is automatically deleted

The base class function is hidden

When you redefine a member function of a base class in a derived class, it is called function hiding. This means that the derived class function will override the base class function, and the base class function will no longer be accessible to objects of the derived class. Option A is incorrect as function overloading means having multiple functions with the same name but different parameters, not redefining a function. Option B is incorrect because the base class function is not automatically deleted, it is simply hidden from the derived class. Option D is incorrect as the derived class function will be called instead of the base class function due to function hiding.

Get further explanation with Examzify DeepDiveBeta

The base class function is called by default

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy