Behind the scenes, each type of variable in C ++ has a numerical representation. This makes sense, because at the basic level of the computer, all that is is numbers. There are two basic primitive data types that (as a rule) are represented as something other than a number, but are actually just numbers. The first is bool , and the second is char .
For example, if you installed
bool myBool = true;
behind the scenes, it really sets your variable to 1 . Similarly, if you install
myBool = false;
0 . .
char myChar = 'a';
char 97. , , table.
, cout bool, "", , -, iostream , bool, "" . . iostream.
iostream, ,
cout << "I can take my road test. " << canTakeRoadtest << endl;
cout << "I can take my road test. false" << endl;
boolalpha, Lovelace42.