exit(int status)函数是中断当前的进程,返回到当前进程的调用者,即系统,
并且还返回给系统一个退出码,即ststus;
我们可以利用DOS中的程序异常结束的返回值errorlevel来获得;
如:
程序exitcode.c
#include <stdlib.h>
void main( void )
{
      exit( 10 );
}

然后写一个批处理文件getexitcode.bat
exitcode.exe
echo %errorlevel%

先编译C程序,然后执行批处理文件就可以发现我们得到了退出码了;

http://blog.sina.com.cn/s/blog_5f18ff880100h52j.html

相关文章:

  • 2021-12-02
  • 2022-02-01
  • 2021-06-21
  • 2022-01-17
  • 2021-11-07
  • 2022-02-03
猜你喜欢
  • 2021-09-26
  • 2022-01-18
  • 2021-10-22
  • 2021-10-03
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案