c++程序—布尔值

#include<iostream>
using namespace std;
#include<string>

int main()
{
    //创建bool数据类型
    bool flag = true;
    cout << flag << endl;
    flag = false;
    cout << flag << endl;
    //bool所占内存空间
    cout << sizeof(bool) << endl;
    system("pause");
    return 0;

}

 

posted @ 2020-02-25 08:57  Jackie_Wang  阅读(331)  评论(0编辑  收藏  举报