c++程序—布尔值

时间:2020-02-25 09:24:40   收藏:0   阅读:47
#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;

}

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!