如果不带参数直接throw;的话,编译可以通过,也没warning,
但debug到throw那一步的话出现类似下面的对话框handling exception that is not defined, Microsoft C++ exception: [rethrow] @ 0x00000000如果随便加个参数如 throw 0;则没事。难道真的一定要参数?
记得看到其他人写的sample的确是没参数的阿。
但debug到throw那一步的话出现类似下面的对话框handling exception that is not defined, Microsoft C++ exception: [rethrow] @ 0x00000000如果随便加个参数如 throw 0;则没事。难道真的一定要参数?
记得看到其他人写的sample的确是没参数的阿。
try {
throw; // 这里出错
}
catch(...) {
// 处理
}
A throw-expression with no operand re-throws the exception currently being handled. Such an expression should appear only in a catch handler or in a function called from within a catch handler. The re-thrown exception object is the original exception object (not a copy).
至于为什么不能被catch(...)捕获,我也不清楚,反正就是不能。
所以想弹出什么错误都随便他们了,
vc2003是在程序运行到那里时出来个对话框说runtime error