Sign in to follow this  

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

This topic is 3503 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have seen in my C++ book that the author sometimes uses:
void virtual sayHi() const;
or
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

This topic is 3503 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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