void exit( int exit_code );
(until C11)_Noreturn void exit( int exit_code );
(since C11)[[noreturn]] void exit( int exit_code );
(since C23)Causes normal program termination to occur.
Several cleanup steps are performed:
exit_code
is zero or EXIT_SUCCESS, an implementation-defined status indicating successful termination is returned. If exit_code
is EXIT_FAILURE, an implementation-defined status indicating unsuccessful termination is returned. In other cases implementation-defined status value is returned.The functions registered with at_quick_exit are not called.
The behavior is undefined if a program calls exit
more than once, or if it calls exit
and quick_exit
The behavior is undefined if during a call to a function registered with atexit, the function exits with longjmp.
Returning from the the main function, either by a return
statement or by reaching the end of the function, executes exit()
, passing the argument of the return statement (or â0â if implicit return was used) as exit_code
.
(none)
[edit] ExamplePossible output:
error opening file data.txt in function main()[edit] References
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4