cout将bool直接输出为true和false
来源:互联网 发布:python 微信菜单开发 编辑:程序博客网 时间:2024/05/18 17:04
cout将bool直接输出为true和false
//---------------------------------------
//使用boolalpha输出为bool类型
//使用noboolalpha输出为数字类型
//--------------------------------------
#include "stdafx.h"
#include <iostream>
using namespace std;
int main(int argc, char* argv[])
{
bool test = true;
cout << "the output is number " << test << endl;
cout << "the output is bool(use boolalpha) " << boolalpha << test << endl;
cout << "the output is number(use noboolalpha) " << noboolalpha << test << endl;
system("pause");
return 0;
}
输出:
the output is number 1
the output is bool(use boolalpha) true
the output is number(use noboolalpha) 1
请按任意键继续. . .
- cout将bool直接输出为true和false
- BOOL,TRUE,FALSE 和 bool ,true, false
- warning C4800: “BOOL”: 将值强制为布尔值“true”或“false”(性能警告)
- warning C4800: “BOOL”: 将值强制为布尔值“true”或“false”(性能警告)
- bool true false
- BOOL与bool TRUE与true FALSE与false 区别
- echo输出true和false的结果
- VS2015--win32工程配置的一些想法之警告:“BOOL”: 将值强制为布尔值“true”或“false”(性能警告)
- bool不初始化的后果:既不为false也不为true
- js bool true false 真假比较
- js bool true false 真假比较
- Debug日志:BOOL与bool,TRUE与true,FALSE与false
- 很多C编译不支持bool型,导致出现false和true未定义
- true和false
- true 和 false
- JS true和false
- JavaScript true 和false
- setOnTouchEvent 设置返回值为true 和 false的区别
- Windows下Nignx+Tornado开发
- Lesson6: 对话框编程
- 使用beanutils操作bean的属性
- discuz登录免激活
- 排序 插入排序,冒泡排序,选择排序,并归排序
- cout将bool直接输出为true和false
- Document对象,Element对象和Node对象简介
- what should i write today?
- python中List的sort方法
- UVa 10892 LCM Cardinality (数论&素因子分解)
- C#中常用的字符串加密,解密方法封装
- js动态 在table任一位置加减行
- linux线程窥探
- 一个工科研究生毕业后的职业规划