cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
return statement
return statement
Mar 14, 2013 at 11:59am UTC
Macthecreator
(6)
what is the difference between
return;
or return NULL;
Mar 14, 2013 at 12:22pm UTC
MikeyBoy
(5631)
The first doesn't return anything.
The second returns the value NULL.
Mar 14, 2013 at 1:00pm UTC
TheIdeasMan
(6817)
The first one is handy for returning from a void function early, but I wouldn't bother for a void function that returns at the end like normal.
For the second one, C++11 has nullptr.
http://en.wikipedia.org/wiki/C%2B%2B11#Null_pointer_constant
Hope all goes well.
Topic archived. No new replies allowed.