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

No members online now.

Forum statistics

Threads
474,175
Messages
2,570,942
Members
47,489
Latest member
BrigidaD91

Latest Threads

Top