C++异常处理问题6

null

#include <iostream>
using namespace std;
int main()
{
try
{
throw 10;
}
catch (...)
{
cout << "default exception" ;
}
catch ( int param)
{
cout << "int exception" ;
}
return 0;
}


(A) 默认例外 (B) int异常 (C) 编译错误 答复: (C) 说明: 将catch all块放在任何其他catch之前是编译器错误。catch(…)必须是最后一个catch块。 这个问题的小测验

© 版权声明
THE END
喜欢就支持一下吧
点赞14 分享