C++
文章平均质量分 67
梁涯飞雨
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
串行化
#include "stdafx.h" #include #include #include #include #include using namespace std; struct TaxInfo; struct SalaryInfo { string name; float salary; TaxInfo * tax; void sa原创 2014-04-17 12:29:17 · 556 阅读 · 0 评论 -
可变参数宏__VA_ARGS__
可变参数宏__VA_ARGS__ 在 GNU C 中,宏可以接受可变数目的参数,就象函数一样,例如: #define pr_debug(fmt,arg...) \ printk(KERN_DEBUG fmt,##arg) 用可变参数宏(variadic macros)传递可变参数表 你可能很熟转载 2014-11-04 22:47:39 · 457 阅读 · 0 评论 -
__func__
__func__标识符 __func__是C99标准里面预定义标识符, 它是一个static const char[], 会在每一个使用__func__的函数里隐式定义. 下面是ISO9899里的例子 #include void myfunc(void) { printf("%s/n", __func__); /* ... */ }转载 2014-11-04 23:16:06 · 2105 阅读 · 0 评论 -
宏定义中的##操作符和... and _ _VA_ARGS_ _
宏定义中的##操作符和... and _ _VA_ARGS_ _ 1.Preprocessor Glue: The ## Operator 预处理连接符:##操作符 Like the # operator, the ## operator can be used in the replacement section of a function-like macro.Ad转载 2014-11-04 22:57:15 · 482 阅读 · 0 评论 -
c++标准定义的__func__
__func__ Or __FUNCTION__,函数局部预定义的变量原创 2014-11-04 23:03:05 · 1075 阅读 · 0 评论 -
使用eclipse编译含有C++11特性的代码
up vote 95 down vote accepted I found this article in the Eclipse forum, just followed those steps and it works for me. I am using Eclipse Indigo 20110615-0604 on Windows with a Cygwin setup转载 2014-05-23 22:14:45 · 1659 阅读 · 0 评论 -
避免异常发生时的资源泄漏
#include using namespace std; class SomeException { public: SomeException() { cout ~SomeException() { cout private: int i; }; void someOtherFunction() { if(1) throw So原创 2014-04-19 01:14:50 · 805 阅读 · 0 评论 -
异常处理
转载 2014-04-17 23:58:57 · 522 阅读 · 0 评论 -
标准程序库异常处理----计算三角形面积
#include "stdafx.h" #include #include using namespace std; ////给出三角形三边长,计算三角面积 double area(double a, double b, double c) throw(invalid_argument) { if(a //logic_error 和runtim转载 2014-04-18 00:59:38 · 1322 阅读 · 0 评论 -
编译时调试模式
#include #include #include using namespace std; #define DEBUG_MODE #ifdef DEBUG_MODE class Logger { public: template static void log(const Args & ... args) { ofstream ofs(msDebugF转载 2014-11-04 23:14:06 · 555 阅读 · 0 评论
分享