assert.h
`assert(condition)` aborts with a message if a programmer assumption is false.
Easy
Disabled when NDEBUG is defined. Use for bugs, not for user input. static_assert(sizeof(int) == 4, "…") checks at compile time.
Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.
Discussion (0)
Sign in or join free to ask questions and discuss this topic.