C Books Guide and List
C++ Books Guide and List
Best Java Books

3,749 questions

4,049 answers

114 comments

10,705 users

Is using exit() the same as using return?

0 votes
1,419 views
asked Apr 7, 2014 by sunny Expert (11,410 points)

1 Answer

0 votes
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.
answered Apr 7, 2014 by rock Expert (14,990 points)

Related questions

0 votes
1 answer 282 views
282 views asked Jan 9, 2014 by sara Guru (24,570 points)
0 votes
1 answer 14 views
14 views asked May 10, 2014 by augustaina Sr Member (4,820 points)
0 votes
1 answer 108 views
0 votes
2 answers 44 views
0 votes
1 answer 1,030 views
1,030 views asked May 27, 2011 by carlton Sr Member (3,990 points)
...