bool、true、false、__bool_true_false_are_defined
stdbool.h:インデックス への移動
ヘッダー ファイル
stdbool.h
カテゴリ
変数の型
プロトタイプ
bool true = 1;
bool false = 0;
bool h = __bool_true_false_are_defined;
説明
stdbool.h ヘッダー ファイルでは、4 つのマクロが定義されており、論理型にマップされています。
例
#include <stdio.h> #include <stdbool.h> int main(int , char**){ bool t = true; bool f = false; bool h = __bool_true_false_are_defined; if (h) printf("foo"); return 0; }
POSIX | Win32 | ANSI C | ANSI C++ |
---|---|---|---|
+ |
+ |
+ |
+ |