文章分类 - BUAA-C++程序设计-2022秋
进行了一些随性的记录
摘要:cppcs 9-6 exception 处理 —— throw void fun(int x) throw(int){ if(x==5) throw 1; } fun(5); 当抛出异常时,需要对异常进行处理 程序异常 -> 操作系统 解决 try { fun(5); } catch (int e)
阅读全文
摘要:C++ 8-30 内存对齐 struct Test { int i; double j; int k; }; sizeof(Test); >>> 24 结构体的默认存储方式采用以最大字节元素字节数对其方式进行对齐 Macro 宏 "函数宏是个讨厌的东西" #define PI 3.14 // 1.
阅读全文