support bazel complie this project and format code.

This commit is contained in:
zhangxing
2023-03-30 00:15:11 +08:00
committed by light-city
parent 1f86192576
commit 7529ae3a55
636 changed files with 10025 additions and 9387 deletions

View File

@@ -0,0 +1,24 @@
// Eg10-7.cpp
#include <iostream>
using namespace std;
//内部再次throw异常的时候函数不要带throw()
void Errhandler(int n) {
try {
if (n == 1)
throw n;
cout << "all is ok..." << endl;
} catch (int n) {
cout << "catch an int exception inside..." << n << endl;
throw n; //再次抛出本catch捕获的异常
}
}
int main() {
try {
Errhandler(1);
} catch (int x) {
cout << "catch int an exception in main..." << x << endl;
}
cout << "....End..." << endl;
return 0;
}