Predefined Boolean constants (since C23)

1 Syntax

# Notes

See integral conversions for implicit conversions from bool to other types and boolean conversions for the implicit conversions from other types to bool.

Until C23, true and false were implemented as macros provided in <stdbool.h>. An implementation may also define bool, true, and false as predefined macros in C23 for compatibility.

# Example

#include <assert.h>
 
int main()
{
    assert(true == 1 && 0 == false);
}

# See also