C语言的函数.

来源:百度知道 编辑:UC知道 时间:2024/05/09 09:59:30
函数名: abort
功 能: 异常终止一个进程

这个函数怎么用?举个详细 简单的例子.
并说明包含在哪个头文件里.
我要提问很多. 回答的好的话我会加分的 我说话算话

#include<process.h>或是#include<stdlib.h>
#include<stdio.h>
#include<process.h>
//using namespace std;
int main()
{
int i;
char ch;
for(i=0;i<100;i++)
{
if(i==50)
abort();
printf("%d\n",i);
}
ch=getchar();
return 0;
}
会出现如下错误信息:

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

函数名: abort
功 能: 异常终止一个进程
用 法: void abort(void);
程序例:
#include <stdio.h>
#include <stdlib.h>

int main(void)
{
printf("Calling abort()\n");
abort();
return 0; /* This is never reached */
}