第二十五章补充内容 6 用宏函数来输出表达式的值

// 第二十五章补充内容 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;
}*/

  

posted @ 2012-10-15 21:47  简单--生活  阅读(155)  评论(0编辑  收藏  举报
简单--生活(CSDN)