parent
8201575044
commit
83afdf27bb
@ -0,0 +1,35 @@
|
|||||||
|
#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";
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue