您的位置:首页 > 其它

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


  
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: