达缇美食
您的当前位置:首页linux中exit和exit区别

linux中exit和exit区别

来源:达缇美食


系统大全为您提供
/*****exit1.c******/#include<stdio.h>#include<stdlib.h>main(){ printf("outputbegin/n");
  printf("contentinbuffer"); exit(0);}
使用了exit()函数,结束进程前,把文件缓冲区内容写回文件。这是比较安全的退出方式。
而下面的_exit()函数,结束进程前,不处理缓冲区,直接清空,这样风险比较大。
 
/*****exit2.c******/#include<stdio.h>#include<unistd.h>main(){printf("outputbegin/n");
printf("contentinbuffer");_exit(0);}
运行结果:
 
上面的:
outputbegincontentinbuffer
 
 
 
下面的:
 
 
outputbegin
 以上就是系统大全给大家介绍的如何使的方法都有一定的了解了吧,好了,如果大家还想了解更多的资讯,那就赶紧点击系统大全官网吧。
本文来自系统大全http:///如需转载请注明!推荐:win7纯净版
显示全文