≫ ホーム ≫ C言語ヘッダファイル別一覧 | C言語アルファベット別一覧 ≫ stdlib.h ≫ abort
プログラムを異常終了します.
#include <stdlib.h>
void abort(void);
abort 関数は異常プログラム終了を発生させます.(ただし,シグナル SIGABRT が補足されていて,シグナルハンドラ (signal handler) が復帰しない場合を除きます.)
abort 関数を実行したときの以下の動作は処理系定義です.
abort 関数を使用してプログラムを異常終了するサンプルプログラムを以下に示します.
/* header files */
#include <stdio.h>
#include <stdlib.h>
/* main */
int main(void) {
printf("異常終了します.\n");
abort();
return EXIT_SUCCESS;
}
サンプルプログラムの実行結果は以下のようになります.
異常終了します.
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.