In the C Programming Language, assert is a macro that is designed to be used like a function. It checks the value of an expression that we expect to be true under normal circumstances. If expression is a nonzero value, the assert macro does nothing.
Where is assert () in C?
h is a header file in the standard library of the C programming language that defines the C preprocessor macro assert() . In C++ it is also available through the <cassert> header file.
What is the purpose of the assert () macro?
The assert() macro is used to check expressions that ought to be true as long as the program is running correctly. It is a convenient way to insert sanity checks.