Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

C Standard Library – <assert.h>


May 11, 2021 C


Table of contents


C Standard Library - slt;assert.h.gt;

Brief introduction

The assert.h header file for the C standard library provides a macro called assert, which can be used to validate assumptions made by the program and output diagnostic messages when assumed to be false.

The defined macro assert points to another macro, NDEBUG, which is not part of the .lt;assert.h> If the NDEBUG is defined as a macro name in the source file that refers to the .

#define assert(ignore) ((void)0)

Library macros

The only functions defined in the header file assert.h are listed below:

Serial number Function & Description
1 void assert(int expression)
This is actually a macro, not a function, which can be used to add diagnostics in the C program.