C | void abort (void); |
C++11 | noreturn void abort() noexcept; |
/* abort example */ #include <stdio.h> /* fopen, fputs, fclose, stderr */ #include <stdlib.h> /* abort, NULL */ int main () { FILE * pFile; pFile= fopen ("myfile.txt","r"); if (pFile == NULL) { fputs ("error opening file\n",stderr); abort(); } /* regular process here */ fclose (pFile); return 0; } |
exit | 终止调用进程(function ) |
atexit | 设置退出时要执行的操作(function ) |