C Tutorial/assert.h/assert

Материал из C\C++ эксперт
Версия от 10:32, 25 мая 2010; Admin (обсуждение | вклад) (1 версия: Импорт контента...)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

assert

Item Value Header file assert.h Declaration void assert(int exp); Function writes error information to stderr and then aborts program execution if the expression exp evaluates to zero.

Define NDEBUG to ignore the assert() macros.


#include <assert.h>
 
  int main(void){
    assert(1==2);
  }