You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
411 B
35 lines
411 B
#include <iostream>
|
|
#include <string>
|
|
using std::cin, std::cout, std::string;
|
|
|
|
void C()
|
|
{
|
|
cout << "start C\n";
|
|
throw -1;
|
|
cout << "End C\n";
|
|
}
|
|
void B()
|
|
{
|
|
cout << "start B\n";
|
|
C();
|
|
cout << "End B\n";
|
|
}
|
|
|
|
void A()
|
|
{
|
|
cout << "start A\n";
|
|
B();
|
|
cout << "End A\n";
|
|
}
|
|
|
|
int main()
|
|
{
|
|
try
|
|
{
|
|
A();
|
|
}
|
|
catch (int)
|
|
{
|
|
cout << "main 处理了 int\n";
|
|
}
|
|
} |