定义了#define NDEBUG ,assert 还生效 的处理方法

正常使用的话,必须导入 #include <assert.h>,这样才能在后面使用断言

 

如果要使断言失效,就必须在assert.h前面新增 NDEBUG,注意!!!!必须紧随上面新增,跨行都不行

#define NDEBUG
#include <assert.h>

posted @ 2022-02-17 08:45  zq爱生活爱代码  阅读(91)  评论(0编辑  收藏  举报