반응형
exit() 함수의 뜻

Header File

stdlib.h

Category

Process Control Routines

Prototype

void exit(int status);

Description

Terminates program.

exit terminates the calling process. Before termination, all files are closed, buffered output (waiting to be output) is written, and any registered "exit functions" (posted with atexit) are called.

status is provided for the calling process as the exit status of the process. Typically a value of 0 is used to indicate a normal exit, and a nonzero value indicates some error. It can be, but is not required, to be set with one of the following:

EXIT_FAILURE Abnormal program termination; signal to operating system that program has terminated with an error
EXIT_SUCCESS Normal program termination


exit 함수는 프로그램을 종료할때 사용합니다. 프로그램 구동중 메인 함수를 return 해서

프로그램을 종료 할 수도 있지만 그렇지 못한경우에 사용합니다.

출처 : C++Builder Help - C Runtime Library Reference

반응형

+ Recent posts