cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
user name:
password:
Forgot your password?
please wait
try again
cancel
forgot your password?
sign up
log in
[Legacy version]
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
difference between void and virtual void
difference between void and virtual void
Mar 21, 2018 at 2:49pm
Mar 21, 2018 at 2:49pm UTC
Mk87
(39)
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 2:49pm UTC
Mar 21, 2018 at 3:01pm
Mar 21, 2018 at 3:01pm UTC
keskiverto
(10424)
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.