- #include <stdio.h>
- #define DEBUG1 1
- #if DEBUG1 == 1
- //显示调试信息
- #define Log(format,...) printf(format,## __VA_ARGS__)
- #else
- //不显示调试信息
- #define Log(format,...)
- #endif
- void test(){
- int a = 10,b=3;
- Log("test--->%d,%d\n",a,b);
- }
- void test1(){
-
- printf("xxxxx\n");
- float b = 10.23f;
- Log("test1--->%.2f\n",b);
-
- }
- int main(int argc, const char * argv[]) {
-
- //DEBUG1 == 1 显示调试信息
- //DEBUG1 == 0 不显示调试信息
- Log("xxxxxxxxxx-->\n");
-
- test1();
- test();
-
- return 0;
- }
复制代码
妈妈再也不用担心我的学习啦 |
|