Ace Your C++ Skills 2025 – Rock the ‘Thinking in C++’ Challenge!

Question: 1 / 565

What is the effect of casting a base class pointer to a derived class pointer when using virtual functions?

It disables virtual function mechanism

It allows access to derived class-specific functions

When casting a base class pointer to a derived class pointer, the virtual function mechanism is still enabled, so option A is incorrect. It also does not have no effect, as option C suggests. Option D is also incorrect, as casting a pointer does not inherently cause memory leaks. However, casting to a derived class pointer allows access to derived class-specific functions, making option B the correct answer. Therefore, option B is the most accurate choice.

Get further explanation with Examzify DeepDiveBeta

It has no effect

It causes memory leaks

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy