摘要: assert宏的原型定义在<assert.h>中,其作用是如果它的条件返回错误,则终止程序执行,原型定义: #include <assert.h> void assert( int expression );assert的作用是现计算表达式 expression ,如果其值为假(即为0),那么它先向stderr打印一条出错信息, 然后通过调用 abort 来终止程序运行。请看下面的程序清单badptr.c: #include <stdio.h> #include <assert.h> #include <stdlib.h>int ma 阅读全文
posted @ 2011-11-16 14:03 kanego 阅读(298) 评论(0) 推荐(0) 编辑