1.利用#ifdef/#endif将某程序功能模块包括进去,以向某用户提供该功能。 在程序首部定义#ifdef HNLD: #ifdef HNLD include"n166_hn.c" #endif 如果不许向别的用户提供该功能,则在编译之前将首部的HNLD加一下划线即可。 2.在每一个子程序前加上标记,以便追踪程序的运行。 #ifdef DEBUG printf(" Now is in...
#ifdef-#endif #ifndef-#endif 用来开发时的测试调试,能够改一个值就可以让这些输出的语句消失(不参与编译),就可以达到一次性把所有调试语句“删除”的目录*/#include<stdio.h>//#define MY_DEBUG#ifndef MY_DEBUG#defineLOG(a,...)#else#defineLOG(a,...) printf(a, ##__VA_ARGS__);//就代表第二...
程序中的#define MACRO A.如对下面这代码: #ifdefine DEBUG printf("debug message\n"); #endif 编译时可加上-DDEBUG参数,执行程序则打印出编译信息 下面的三个参数会迫使cc检查你的代码是否符合一些国际标准,经常被我们叫做ANSI标准,虽然严格的来说它是一个ISO标准。 -Wall 打开所有cc的作者认为值得注意的警告。
一共有两种情况:一种是用-DMACRO,相当于在程序中使用#define MACRO,另一种是用-DMACRO=A,相当于程序中的#define MACRO A.如对下面这代码: #ifdefine DEBUG printf("debug message\n"); #endif 编译时可加上-DDEBUG参数,执行程序则打印出编译信息 下面的三个参数会迫使 cc 检查你的代码是否符合一些国际标...
#ifdefine DEBUG printf("debug message/n"); #endif 编译时可加上-DDEBUG参数,执行程序则打印出编译信息 5. -I 可指定查找include文件的其他位置.例如,如果有些include文件位于比较特殊的地方,比如/usr/local/include,就可以增加此选项 如下: $cc -c -I/usr/local/include -I/opt/include hello.c此时目录...
第二十二:指针类型 ---c语言的数据类型 #定义带*的类型 char x;//对应的指针类型char*x;short y;short*y;int z;int*z;float f;float*f;double d;double*d;//结构体指针student st;student*st; #指针变量的赋值 char*x;short*y;int*z;//需要在赋值前进行强制类型转换x=(char*)1;y=(short*)2;...
wxUSE_UNICODE #define _T (x) x ttelse /* Unicode */ /* use wxCONCAT HELPER so that x could be expanded if its a macro */ ifdefine _T (x) wxCONCAT_HELPER (L, x) #endif /* ASCII/Unicode */ #endif /* !defined(_T) */ T 在 UNICODE下面最终会被替换成L ntt x 。 ##是一...
We read every piece of feedback, and take your input very seriously. Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly Cancel Create saved search Sign in Sign up Reseting focus {...
(LINUX_KERNEL_MD5SUM) endef ifdef CONFIG_COLLECT_KERNEL_DEBUG define Kernel/CollectDebug rm -rf $(KERNEL_BUILD_DIR)/debug mkdir -p $(KERNEL_BUILD_DIR)/debug/modules $(CP) $(LINUX_DIR)/vmlinux $(KERNEL_BUILD_DIR)/debug/ -$(CP) \ $(STAGING_DIR_ROOT)/lib/modules/...
#ifdefine DEBUG debug code #endif 这样如果编译release版本,debug code在预编译生成的目标文件里不会有,精简了最终生成的二进制文件的大小。 除此以外,预编译也经常用来进行跨平台程序的编写,例如 #ifdefine _IA64_ intel 64位平台下运行的代码 #endif ...