a**U 发帖数: 115 | 1 #include
#include
using namespace std;
class A{
public:
A(){}
~A(){throw "aa";}
};
int main(int argc, char** argv){
try{
A a;
try{
A b;
A c;
}catch(...){
cout<<"kkk1"<
}
}catch(...){
cout<<"kkk2"<
}
cout<<"kkk3"<
return 0;
}
program crash. 请问怎么就crash了?
如果去掉"A c;",一切正常. 谢谢! | P*****f 发帖数: 2272 | 2 http://www.parashift.com/c++-faq-lite/exceptions.html#faq-17.3
#include
#include
using namespace std;
class A{
public:
A(){}
~A(){throw "aa";}
};
int main(int argc, char** argv){
try{
A a;
try{
A b;
A c;
}catch(...){
cout<<"kkk1"<
}
}catch(...){
cout<<"kkk2"<
}
cout<<"kkk3"<
return 0;
}
program crash. 请问怎么就crash了?
如果去掉"A c;",一切正常. 谢谢!
【在 a**U 的大作中提到】 : #include : #include : using namespace std; : class A{ : public: : A(){} : ~A(){throw "aa";} : }; : int main(int argc, char** argv){ : try{
| a**U 发帖数: 115 | 3 谢谢!
【在 P*****f 的大作中提到】 : http://www.parashift.com/c++-faq-lite/exceptions.html#faq-17.3 : : #include : #include : using namespace std; : class A{ : public: : A(){} : ~A(){throw "aa";} : };
|
|