c++ primer 第一章

    技术2022-05-19  20

    1. 如果定义了 DEBUG

    #ifdef DEBUG

    #endif

    编译的时候 $CC  -DDEBUG main.c

     

     

    2. 几个常用的预定义名称

    __LINE__

    __FILE__

    __TIME__

    __DATE__

     

    assert() 是C语言标准库中提供的一个通用预处理器宏。

    常用来判断一个必需的前提条件,以便程序能正确执行。

     

    #include<assert.h>

    assert( filename !=0);

     

    c++中用

    #include <cassert>

    using namespace std;

    使用c时可以直接

    #include<assert.h>

    就可以调用 assert(),

     

     


    最新回复(0)