Contents |
true | (1) | (since C23) | |||||||
false | (2) | (since C23) | |||||||
Keywordstrue andfalse represent predefined constants. They arenon-lvalues of typebool.
Seeintegral conversions for implicit conversions frombool to other types andboolean conversions for the implicit conversions from other types tobool.
Until C23,true andfalse were implemented as macros provided in<stdbool.h>. An implementation may also definebool,true, andfalse as predefined macros in C23 for compatibility.
#include <assert.h> int main(){assert(true==1&&0==false);}
C++ documentation forBoolean literals |