且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

浮点异常无法捕获?

更新时间:1970-01-01 07:54:36

您将获得一个浮点异常(这不是C ++异常),这就是为什么它不可捕获的原因。

You’re getting a "floating point exception" (which is not a C++ exception), that's why its not catchable.

https://www.quora.com/Why-isn%E2%80% 99t-this-catch-block-in-C ++-捕获任何异常

我建议保护进行输入验证。

在您的代码中,异常发生在您开始扔东西之前。

In your code, the exception happens before you start throwing stuff.