C 库函数 - exit()

C 语言教程 · 2019-02-24 08:44:14

描述

C 库函数 void exit(int status) 立即终止调用进程。任何属于该进程的打开的文件描述符都会被关闭,该进程的子进程由进程 1 继承,初始化,且会向父进程发送一个 SIGCHLD 信号。

声明

下面是 exit() 函数的声明。

void exit(int status)

参数

  • status -- 返回给父进程的状态值。

返回值

该函数不返回值。

实例

下面的实例演示了 exit() 函数的用法。

#include <stdio.h>
#include <stdlib.h>

int main ()
{
   printf("程序的开头....\n");
   
   printf("退出程序....\n");
   exit(0);

   printf("程序的结尾....\n");

   return(0);
}

让我们编译并运行上面的程序,这将产生以下结果:

程序的开头....
退出程序....

点击查看所有 C 语言教程 文章: https://codercto.com/courses/l/17.html

查看所有标签

Numerical Linear Algebra

Numerical Linear Algebra

Lloyd N. Trefethen、David Bau III / SIAM: Society for Industrial and Applied Mathematics / 1997-06-01 / USD 61.00

Numerical Linear Algebra is a concise, insightful, and elegant introduction to the field of numerical linear algebra.一起来看看 《Numerical Linear Algebra》 这本书的介绍吧!

在线进制转换器
在线进制转换器

各进制数互转换器

MD5 加密
MD5 加密

MD5 加密工具

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具