Related questions
What is the printf format specifier for bool?
Since ANSI C99 there is _Bool or bool via stdbool.h. But is there also a printf format specifier for bool?
I mean something like in that pseudo code:
bool x = true;
printf("%B\n", x);
which would print:
true
Easiest way to flip a boolean value?
I just want to flip a boolean based on what it already is. If it's true - make it false. If it's false - make it true.
Here is my code excerpt:
switch(wParam) {
case VK_F11:
if (flipVal == true) {
…
Converting bool to text in C++
Maybe this is a dumb question, but is there any way to convert a boolean value to a string such that 1 turns to "true" and 0 turns to "false"? I could just use an if statement, but it would be nice …