什么时候会在CPP中抛出系统异常 [英] When will be system exception thrown in CPP

查看:92
本文介绍了什么时候会在CPP中抛出系统异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以帮助我知道系统异常的所有条件。

尝试{

...

} catch(const std :: exception&e){

printf(failed(%s),e.what());

}



输出 - 失败(系统异常)。



我在网上搜索并发现这是一般例外。





任何人都可以帮我找到系统异常的原因。另外,代码更改为详细原因



提前谢谢。

Can anyone please help me to know in what all the conditions a system exception is thrown.
try {
...
}catch (const std::exception & e) {
printf( "failed(%s)",e.what());
}

output-- failed(system exception).

I searched in net and came to know that this is generic exception.


Can anyone help me to find the reason for system exception. also, the code changes for the the detailed reason for it

Thanks in advance.

推荐答案

开始通过查看调试器中的异常对象。

是否有消息?堆栈跟踪?内在的例外?



您需要使用调试器来查看正在发生的事情 - 一般例外就是:泛型。而且我们不能告诉你它因此而发生因为它是通用的 - 它可能是任何原因。我们甚至无法看到您的代码,更不用说运行它并找到你了!
Start by looking at the exception object in the debugger.
Does it have a message? A stack trace? An Inner Exception?

You need to use the debugger to look at exactly what is happening - a generic exception is just that: generic. And we can't tell you "it happens because of this" because it is generic - it could be any cause. We can't even see your code, much less run it and find out for you!


这篇关于什么时候会在CPP中抛出系统异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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