首页 > 其他 > 详细

调试代码插入宏

时间:2014-04-10 20:59:45      阅读:379      评论:0      收藏:0      [点我收藏+]
bubuko.com,布布扣
 1 #include <stdio.h>
 2 
 3 #define __DEBUG__
 4 
 5 #ifdef __DEBUG__
 6 #define DEBUG(format,...) printf("File: "__FILE__", Line: %05d: "format"\n", __LINE__, ##__VA_ARGS__)
 7 #else
 8 #define DEBUG(format,...)
 9 #endif
10 
11 int main(int argc, char **argv) {
12     char str[]="Hello World";
13     DEBUG("A ha, check me: %s",str);
14     printf("File: "__FILE__", Line: %05d: A ha, check me: %s\n", __LINE__, str);
15     while(1);
16     return 0;
17 }
bubuko.com,布布扣

 

调试代码插入宏,布布扣,bubuko.com

调试代码插入宏

原文:http://www.cnblogs.com/zhaoli/p/3656293.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!