<<< Boolean Type | Index | Character Data Type >>> |
Boolean types can be converted to plain integer numbers and back:
int main() { int i = -1; bool b = i; // b will be true int x = b; // x will be set to 1 x = 0; b = x; // b will be set to false return 0; }
Note: no assumptions should be made regarding the size of bool type. On many systems it takes 8 bits to store a boolean variable.
<<< Boolean Type | Index | Character Data Type >>> |