请输入您要查询的百科知识:

 

词条 Exit()
释义

函数名: exit()

所在头文件:stdlib.h

功 能: 关闭所有文件,终止正在执行的程序。

exit(1)表示异常退出.这个1是返回给操作系统的不过在DOS好像不需要这个返回值

exit(x)(x不为0)都表示异常退出

exit(0)表示正常退出

用 法: void exit(int status);

参 数 : status //程序退出的返回值.

程序例:

#include <stdlib.h>

#include <conio.h>

#include <stdio.h>

int main(void)

{

int status;

printf("Enter either 1 or 2\");

status = getch();

/* Sets DOS errorlevel */

exit(status - '0');

/* Note: this line is never reached */

return 0;

}

随便看

 

百科全书收录4421916条中文百科知识,基本涵盖了大多数领域的百科知识,是一部内容开放、自由的电子版百科全书。

 

Copyright © 2004-2023 Cnenc.net All Rights Reserved
更新时间:2025/3/2 1:30:25