Sign in to follow this  

What's the difference between virtual void something() and void virtual something()?

Recommended Posts

sheep19    494
I have seen in my C++ book that the author sometimes uses:
void virtual sayHi() const;
virtual void sayHi() const;
What's the difference? (I've seen later that he used virtual void hi() const = 0; to make it pure virtual, could I use void virtual hi() const = 0; ?) If they are the same, which is used more often?

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this