当应用程序与运行库的一个调试版本链接时
,abort
建立一个有三个
按钮
:Abort
、
Retry
和
Ignore
的消息框。如果用户选择
Abort,
该程序立
即终止
;
如果用户选择
Rerty,
调用调试器
,
如果允许及时调试则调试该程序
;
如果用户选择
Ignore,abort
继续它的正常执行
,
建立一个带
OK
按钮的消
息框。有关更多的信息
,
参见联机帮助《
Visual C++
程序员指南》中的
“
使
用
C
运行库调试支持
”
。
例子
/* ABORT.C: this program tries to open a
* file and aborts if the attempt fails.
*/
# include <stdio.h>
# include <stdlib.h>
void main( void )
{
FILE *stream;
if( (stream = fopen( "NOSUCHF.ILE", "r" )) == NULL )
{
perror( "Couldn't open file" );
abort();
}
else
评论0