when should we add a "virtual"

in the base class, there is a virtual function
when the we want to override the virtual function in derived class
need we add a 'virtual' before the definition of overriding function?

some article said if the virtual function is a pure one, you should
add a 'virtual' before all the overriding functions in the derived classes

need we?
If a base class declares a function to be virtual, all derived classes see that function as virtual whether they use the virtual keyword or not.
duplicate!!!
you mean the 'virtual' keyword is duplicate, however, error won't be raised due to the duplicate?
hahahahaha... good one...

i mean this was duplicate for me.. i already answered this question in another post, posted by you.. :)
I just post an example after fellows here gave me directions.

http://www.cplusplus.com/forum/beginner/10884/

Maybe it could help you get it also.
Topic archived. No new replies allowed.