Print a Boolean
C Approach
bool myBoolean = true;
printf("The value is %s", (myBoolean) ? "true" : "false");
// The value is true
C++ Approach
boolean myBoolean = true;
std::cout << "The value is " << myBoolean << std::endl;
// The value is 1
bool myBoolean = true;
printf("The value is %s", (myBoolean) ? "true" : "false");
// The value is true
boolean myBoolean = true;
std::cout << "The value is " << myBoolean << std::endl;
// The value is 1