Six, C ++ type bool (bool)
1, BOOL type in C ++ basic data types, specifically represent logical value;
2, BOOL of one byte in memory, represents a logical true, a logical 0 indicates false;
. 3, BOOL variable can accept any type of expression As a result, compared with a non-zero value true (1), a value of 0 was false (0).
bool.cpp
#include <iostream>
using namespace std;
int main(void){
bool b = false;
cout << "size=" << sizeof(b) << endl;//1
cout << b << endl;//0
b = 123;
cout << b << endl;//1
b = 3.14;
cout << b << endl;//1
char* p = NULL;//NULL-->(void *)0
b = p;
cout << b << endl;//0
return 0;
}