Easy Tutorial
❮ C File Io C Examples Display Alphabets ❯

C Standard Library - <assert.h>

Introduction

The assert.h header file of the C Standard Library provides a macro called assert, which can be used to verify assumptions made by the program and output diagnostic messages if the assumption is false.

The predefined macro assert points to another macro NDEBUG, which is not part of <assert.h>. If NDEBUG has been defined as a macro name in the source file that includes <assert.h>, the definition of the assert macro is as follows:

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

Library Macros

The following is the only function defined in the assert.h header file:

Number Function & Description
1 void assert(int expression) <br> This is actually a macro, not a function, and is used to add diagnostics to C programs.
❮ C File Io C Examples Display Alphabets ❯