'exit함수'에 해당되는 글 1건

  1. 2008.04.25 exit() 함수의 뜻
프로그래밍2008. 4. 25. 19:02
반응형
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

반응형
Posted by pmj0403