gccException

runwu2204 Lv6

浅析 C++ 异常机制 | SOLOTZG

https://4nsw3r.top/2022/02/03/SCTF-REVERSE-CplusExceptionEncrypt-%E8%B5%9B%E5%90%8E%E5%A4%8D%E7%8E%B0

基本格式

1
2
3
4
5
6
7
8
9
10
11
12
13
#include<iostream>
#include<exception>
int main(){
try
{
throw std::exception();//抛出异常,对象需要继承 exception 基类
}
catch(const std::exception& e)
{
std::cerr << e.what() << '\n';//异常处理语句
}

}
  • 标题: gccException
  • 作者: runwu2204
  • 创建于 : 2024-04-24 21:39:24
  • 更新于 : 2024-04-25 13:33:20
  • 链接: https://runwu2204.github.io/2024/04/24/Re/语言逆向/C&C++/gccException/
  • 版权声明: 本文章采用 CC BY-NC-SA 4.0 进行许可。
评论
目录
gccException