C / C ++中的例外 [英] Exceptions in C/C++

查看:92
本文介绍了C / C ++中的例外的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


我对此类代码有疑问:


__try

{

...

} __except(EXCEPTION_EXECUTE_HANDLER)

{

printf("异常代码:%。8x \ n" ;,GetExceptionCode());

}

C相关代码?或者也许是C ++?


opexoc

Hello,

I have question concerning such code:

__try
{
...
} __except(EXCEPTION_EXECUTE_HANDLER)
{
printf("Exception code: %.8x\n", GetExceptionCode());
}
Is C related code? Or maybe C++?

opexoc

推荐答案

op **** @ gmail.com 写道:

您好,


我对此类代码有疑问:


__try

{

...

} __except(EXCEPTION_EXECUTE_HANDLER)

{

printf("异常代码:%。8x \ n",GetExceptionCode());

}


C相关代码?或者也许是C ++?
Hello,

I have question concerning such code:

__try
{
...
} __except(EXCEPTION_EXECUTE_HANDLER)
{
printf("Exception code: %.8x\n", GetExceptionCode());
}
Is C related code? Or maybe C++?



它不是ISO C,而是Microsoft特定的C,请参阅他们的MSDN文档。


-

Tor< bw **** @ wvtqvm.vw | tr i-za-h a-z>

It''s not ISO C, but Microsoft specific C, see their MSDN doc.

--
Tor <bw****@wvtqvm.vw | tr i-za-h a-z>


所以如果我想在C代码中使用dev-cpp中的异常捕获那么

我应该这样做吗?


On 7 Gru,01:58,Tor Rustad< tor_rus ... @ hotmail.comwrote:
So if I want to use exceptions catching in dev-cpp in C code then what
should I do?

On 7 Gru, 01:58, Tor Rustad <tor_rus...@hotmail.comwrote:

>

它不是ISO C,而是Microsoft特定的C,请参阅他们的MSDN文档。
>
It''s not ISO C, but Microsoft specific C, see their MSDN doc.



op****@gmail.com 写道:

所以如果我想在C代码中使用dev-cpp中的异常捕获那么我应该做什么



On 7 Gru,01:58,Tor Rustad< tor_rus ... @ hotmail.comwrote:
So if I want to use exceptions catching in dev-cpp in C code then what
should I do?

On 7 Gru, 01:58, Tor Rustad <tor_rus...@hotmail.comwrote:

>它不是ISO C,而是Microsoft特定的C,请参阅他们的MSDN文档。
>It''s not ISO C, but Microsoft specific C, see their MSDN doc.




如果使用lcc-win编译器,可以使用

__try / __ except结构。


以下网址


-

jacob navia

jacob at jacob point remcomp point fr

logiciels / informatique
http://www.cs.virginia.edu/~lcc-win32


这篇关于C / C ++中的例外的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆