第二十五章补充内容 6 用宏函数来输出表达式的值
2012-10-15 21:47
197 查看
// 第二十五章补充内容 6 用宏函数来输出表达式的值 /*#define DEBUG #include <iostream> using namespace std; #ifndef DEBUG #define show(x) #else #define show(x)\ cout<<#x<<": \t"<<x<<endl; #endif int main() { int x = 9; show(x); //9 int *y = &x; show(*y); //9 show(y); //内存地址 char *ch="hello world"; show(ch); //字符串 return 0; }*/
相关文章推荐
- 使用Text...Endtext输出文本行、表达式和函数的结果及内存变量的内容
- 第二十五章补充内容 13联合数据类型的内存占用
- 第二十五章补充内容 14匿名联合体
- 第二十五章补充内容 15再谈指针
- 第二十五章补充内容 16 位运算
- 第二十五章补充内容 17位字段
- 三、Ubuntu Server上安装Matlab,利用X11和Putty输出窗口到Windows桌面(补充内容)
- 第二十五章补充内容 18区域差异
- 第二十五章补充内容 3 assert()宏
- 第二十五章补充内容 4 尝试编写一个简单的assert()宏
- 第二十五章补充内容 5 不能为0的变量
- 第二十五章补充内容 7 调试的级别
- string字符串的方法(利用正则表达式分隔字符串,过滤无关内容,输出单词)
- MFC程序(VS2010)检测内存泄露关于信息输出内容补充说明
- 第二十五章补充内容 1 预处理过程
- 第二十五章补充内容 8 C++类型转换及运行时类型信息(RTII)
- 第二十五章补充内容 2 预定义的宏
- 第二十五章补充内容 9 关键字volatile
- 第二十五章补充内容 10 关键字const
- C#正则表达式获取组名,按照组名输出匹配内容