`
yaojingguo
  • 浏览: 207902 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

#if and #ifdef in C

 
阅读更多

#include <stdio.h>

#define debug 0

int main(int argc, const char *argv[]) {
#if debug
	printf("#if\n");
#endif

#ifdef debug
	printf("#ifdef\n");
#endif
}
 
分享到:
评论

相关推荐

    C Programming

    In this section, the document begins by explaining the fundamentals of computers, which is essential for understanding programming and the context in which C programming operates. It covers: - **...

    8192CU LINUX驱动

    if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA * * ******************************************************************************/ ...

    优化秘籍:C语言预处理器宏的高级应用

    #define INC(x) ((x) + 1) ``` - **避免复杂的表达式**:过于复杂的宏表达式可能会导致难以发现的错误。简化宏定义有助于提高代码的可读性和可维护性: ```c // 复杂的宏定义,难以理解 #define COMPLEX_...

    Binl_Server.zip

    * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* Compilation on linux: gcc binlsrv.c -o binlsrv * Compilation on mingw: gcc binlsrv.c -o binlsrv -lws2_32 * ...

    cocos2d-x c++的iconv.rar

    If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* When installed, this file is called "iconv.h". */ #ifndef _LIBICONV_H #...

    NTLM PPROXY client的实现(C source code)

    is identified as the "RSA Data Security, Inc. MD4 Message-Digest Algorithm" in all material mentioning or referencing this software or this function. License is also granted to make and use ...

    stm32+基于3.1.0库+建工程说明

    - **新增内容**: 该文件是3.1.0版本中新引入的,主要用于系统RCC(Reset and Clock Control)的初始化配置。 - **配置示例**: 例如,要将系统时钟配置为72MHz,可以通过如下方式定义: ```c #define SYSCLK_FREQ_...

    Google C++ Style Guide(Google C++编程规范)高清PDF

    More complex inline functions may also be put in a .h file for the convenience of the implementer and callers, though if this makes the .h file too unwieldy you can instead put that code in a ...

    opengl编程基础源代码

    If you compile and link your code from a command line, then the following Makefile should work on most linux systems. Use the LDLIBS line that fits your X11 installation. C = gcc #LDLIBS = -lglut -...

    NexusDB V2 - Full

    NexusDB can run on any windows version from Windows 98 onward, on any PC with a Pentium or ... If required, MMX can be ifdef'ed out to support non-MMX Pentium and Pentium Pro CPU's (in nxDefine.inc).

    Posix多线程程序设计源码

    * allows the err_abort and errno_abort macros to be used as if they * were function calls, even in contexts where a trailing ";" would * generate a null statement. For example, * * if (status != ...

    wtc配置与实例参考

    /* Some compilers warn if argc and argv aren't used. */ argc = argc; argv = argv; /* userlog writes to the central TUXEDO message log */ userlog("Welcome to the simple server"); return(0); } ...

    stdafx.h代码

    #ifdef _INC_WINDOWSX // The following names from WINDOWSX.H collide with names in this header #undef SubclassWindow #undef CopyRgn #endif #ifdef _AFX_PACKING #pragma pack(push, _AFX_PACKING) #endif ...

    uboott移植实验手册及技术文档

    #ifdef CONFIG_S3C2410_NAND_BOOT @ reset NAND mov r1, #NAND_CTL_BASE ldr r2, =0xf830 @ initial value str r2, [r1, #oNFCONF] ldr r2, [r1, #oNFCONF] bic r2, r2, #0x800 @ enable chip str r2, [r1, #...

    Bochs - The cross platform IA-32 (x86) emulator

    - Print detailed page walk information and attributes in internal debugger 'page' command - Updated/Fixed instrumentation callbacks - Configure and compile - Bochs now can be compiled as native ...

    经典的DSP的C程序和汇编程序库

    /* COEFFICIENTS ARE RETURNED IN ARRAYS D AND C */ /* LN SPECIFIES ARRAY SIZE (LN&gt;=L) */ /* WSCL CONTROLS FREQUENCY SCALING SUCH THAT RESPONSE AT 1 RAD/SEC */ /* IS EQUAL TO THAT OF UNSCALED H(S) AT ...

    开发PHP扩展详细教程

    if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,\"sss\",&src,&srclen,&cert,&certlen,&vsignedbuf,&vsignedbuflen) == FAILURE){ return; } fp = fopen(cert,\"rb\"); if(fp == NULL) { return...

    C++中用MFC制作的通讯录

    // If you are not using these features and wish to reduce the size // of your final executable, you should remove from the following // the specific initialization routines you do not need. #ifdef...

    ( ap6181_sina33m_sc3817r验证通过_20170710_1608没有外层目录.7z

    # See the License for the specific language governing permissions and # limitations under the License. # -include hardware/broadcom/wlan/bcmdhd/config/config-bcm.mk WIFI_DRIVER_FW_PATH_STA := "/...

    C++知识点.docx

    cout , b and c: "; cin &gt;&gt; a &gt;&gt; b &gt;&gt; c; double discriminant = b * b - 4 * a * c; if (discriminant &gt; 0) { cout ; } else if (discriminant == 0) { cout ; } else { cout ; } return 0; } ``` ##...

Global site tag (gtag.js) - Google Analytics