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

3,749 questions

4,049 answers


10,705 users

Is using exit() the same as using return?

0 votes
asked 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 by rock Expert (14,990 points)

Related questions

0 votes
1 answer 322 views
0 votes
1 answer 15 views
15 views asked by augustaina Sr Member (4,820 points)
0 votes
2 answers 45 views
0 votes
1 answer 1,039 views
1,039 views asked by carlton Sr Member (3,990 points)