C:assert
lastmod 2026-11-10created 2019-09-264 edits
assert is a macro provided by the C standard header assert.h that prints the file name and line number and aborts the program if the condition expression is false. It is meant for verifying conditions the code assumes during development, and all of them are removed when compiling with the NDEBUG macro defined. It is not used for real error handling such as input validation.