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

Get more with Examzify Plus

Remove ads, unlock favorites, save progress, and access premium tools across devices.

FavoritesSave progressAd-free
From $9.99Learn more

1 / 565

Can a pure virtual function have a definition in C++?

Yes, always

No, never

Yes, but only in derived classes

Yes, in the base class

A This is incorrect because pure virtual functions cannot have any definition in the base class.

B: This is also incorrect because a pure virtual function can have a declaration with no definition in the base class.

C: While this may seem correct, it is not the most accurate answer. A pure virtual function can have a definition in a derived class, but it must also be overridden in any further derived classes.

D: This is the correct answer. A pure virtual function can have a definition in the base class, as long as it is not used to create objects of that class and is overridden in any further derived classes.

Get further explanation with Examzify DeepDiveBeta
Next Question
Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy