return statement

what is the difference between
return;
or return NULL;
The first doesn't return anything.

The second returns the value NULL.
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.