分析以下程序的执行结果。[
#include
using namespace std;
class MyException { };
void testFun(int test) ;
int main()
{
try{
for(int i=0; i<3; i++)
testFun(i);
cout << "in try"<<endl;
}
catch(...)
{
cout<<"catch all "<<endl;
}
cout << "End"<<endl;
return 0;
}
void testFun(int test) {
try{
if(test==1) throw MyException();
if(test==2) throw "Error!";
cout<<"In testFun "<<endl;
} catch(char*) { cout<<"catch char* "<<endl;
}
catch(MyException&) { cout<<"catch MyException "<<endl;
}
}