From 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 7 Apr 2024 13:41:34 -0500 Subject: new repository --- devdocs/c/language%2Fbool_constant.html | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 devdocs/c/language%2Fbool_constant.html (limited to 'devdocs/c/language%2Fbool_constant.html') diff --git a/devdocs/c/language%2Fbool_constant.html b/devdocs/c/language%2Fbool_constant.html new file mode 100644 index 00000000..f3be4efd --- /dev/null +++ b/devdocs/c/language%2Fbool_constant.html @@ -0,0 +1,21 @@ +

Predefined Boolean constants (since C23) +

Syntax

+ + +
true (1) (since C23)
false (2) (since C23)

Explanation

Keywords true and false represent predefined constants. They are non-lvalues of type bool.

+

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 <stdio.h>
+ 
+int main(void)
+{
+    printf("%d\n%d\n", true, false);
+}

Output:

+
1
+0

See also

+
C++ documentation for Boolean literals
+

+ © cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
+ https://en.cppreference.com/w/c/language/bool_constant +

+
-- cgit v1.2.3