Is using exit() the same as using return?

by Vijayaprasad 2010-02-16 10:05:06

No. The exit() function is used to exit your program and return control to the operating system. The return statement is used to return from a function and return control to the calling function. If you issue a return from the main() function, you are essentially returning control to the calling function, which is the operating system. In this case, the return statement and exit() function are similar.

Tagged in:

932
like
0
dislike
0
mail
flag

You must LOGIN to add comments