VC里面的exit(1);

来源:百度知道 编辑:UC知道 时间:2024/05/16 02:28:45
VC里面的这句代码是什么意思
exit(1);
请详细介绍exit的出处和详细用法,
谢谢

exit(0) 正常中止程序 exit(非0) 非正常中止程序

stdlib.h
Run-Time Library Reference
exit, _exit
Terminate the calling process after cleanup (exit) or immediately (_exit).
void exit(
int status
);
void _exit(
int status
);

Parameters
status
Exit status.

Remarks
The exit and _exit functions terminate the calling process. exit calls, in last-in-first-out (LIFO) order, the functions registered by atexit and _onexit, then flushes all file buffers before terminating the process. _exit terminates the process without processing atexit or _onexit or flushing stream buffers. The status value is typically set to 0 to indicate a normal exit and set to some other value to indicate an error.

Although the exit and _exit calls do not return a value, the low-order byte of status is made available to the waiting calling process, if one exists, after the calling process exits. The status value is availab