计算机二级辅导:标准库assert.h

2014-11-15 22:20:23 · 作者: · 浏览: 27

  打算趁留在学校的最后一段时间好好补习一下一直以来都忽略掉的C/C++标准库,大概就是以头文件为单位了。以一个最简单的头文件入手,然后逐渐展开来……第一个头文件当然非assert.h莫属了。这个范例是i386-pc-mingw32中的GCC 4.5.0下包含的。


  view sourceprint /*


  * assert.h


  * This file has no copyright assigned and is placed in the Public Domain.


  * This file is a part of the mingw-runtime package.


  * No warranty is given; refer to the file DISCLAIMER within the package.


  *


  * Define the assert macro for debug output.


  *


  */


  /* We should be able to include this file multiple times to allow the assert


  macro to be enabled/disabled for different parts of code. So don't add a


  header guard. */


  #ifndef RC_INVOKED


  /* All the headers include this file. */


  #include <_mingw.h>


  #undef assert


  #ifdef __cplusplus


  extern "C" {


  #endif


  #ifdef NDEBUG