virtual for all derived class

Q

Quick Function

If I define a virtual method in a class, the same method in all
derived classes, no matter it is labeled by "virtual" or not in the
derived class, will be virtual, right?
 
H

Howard

Quick Function said:
If I define a virtual method in a class, the same method in all
derived classes, no matter it is labeled by "virtual" or not in the
derived class, will be virtual, right?

Correct.

But, I'd label them as virtual in any case, so that later, you (or someone
else) doesn't have to go searching through the hierarchy to *see* if a
function if virtual or not.

-Howard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,338
Messages
2,571,778
Members
48,579
Latest member
sbellus

Latest Threads

Top