difference between void and virtual void

Mar 21, 2018 at 2:49pm
In the base class in visual studio, which time I must use void and virtual void and what's a difference between them?
Last edited on Mar 21, 2018 at 2:49pm
Mar 21, 2018 at 3:01pm
void? The void, int, double, std::vector<Foo>, etc are return types of member functions (in your case). A function returns void, if it does not return a value.


That has nothing to do with virtual. Virtual is not about type. Virtual affects class inheritance.
See http://www.cplusplus.com/doc/tutorial/polymorphism/
Topic archived. No new replies allowed.