setjmp/trycatch

This commit is contained in:
xushiwei
2024-06-08 00:08:29 +08:00
parent d4249da131
commit fcf3f2abc7
8 changed files with 16 additions and 13 deletions

View File

@@ -0,0 +1,13 @@
#include <exception>
#include <stdio.h>
extern "C" void throwCppException();
int main() {
try {
throwCppException();
} catch (std::exception& e) {
printf("Hi, %s\n", e.what());
}
return 0;
}