会员
周边
众包
新闻
博问
闪存
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
林光伟
博客园
首页
新随笔
联系
订阅
管理
2012年10月24日
使用宏来打印变量
摘要: #define PRINT_INT( n ) printf( #n " = %d\n", n )#define PRINT_STRING( s ) printf( #s " = %s\n", s )//使用方法void test(void){ int a = 0; char str[] = "test string"; a++; PRINT_INT(a); PRINT_STRING(str);}
阅读全文
posted @ 2012-10-24 23:14 林德伟
阅读(203)
评论(0)
推荐(0)
编辑