关于throw exception的一个问题
程序如下:
下面是反汇编:

程序就是在执行黄色箭头那一句时报错。我初学C++,汇编代码看不懂请各位前辈指点一下怎么解决这个问题,谢谢了!
[解决办法]
在弹出的对话框按相应按钮进入调试,按Alt+7键查看Call Stack里面从上到下列出的对应从里层到外层的函数调用历史。双击某一行可将光标定位到此次调用的源代码或汇编指令处。
[解决办法]
那你得catch它然后打印啊
最简单的示例:
#include<iostream>
#include<stdexcept>
using namespace std;
void main()
{
try{
throw runtime_error("Data must refer to same ISBN");
}catch(runtime_error& e){
cout<<e.what()<<endl;
}
}
[解决办法]
这个在catch里面处理啊
#include<iostream>
#include<stdexcept>
using namespace std;
void main()
{
try{
throw runtime_error("Data must refer to same ISBN");
}catch(runtime_error& e){
cout<<e.what()<<endl;
return;//or exit(-1);
}
cout<<"here!!"<<endl;
}
要会变通啊,要是不考虑异常,你肯定能想到这个的