【c++11关键字】 bool
作者:
小鱼号的代码日记 | 来源:发表于
2020-10-19 18:57 被阅读0次/*
* c++11关键字
* bool
* 小鱼号的代码日志
*/
#include <QCoreApplication>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
bool b = false;
*(reinterpret_cast<char *>(&b)) = -1;
if(b == true)
{
cout << "i am true";
}
else if(b == false)
{
cout << "i am false";
}
else
{
cout << "i am what";
}
///bool判断的正确写法
if(b)
{
cout << "bool";
}
return a.exec();
}
本文标题:【c++11关键字】 bool
本文链接:https://www.haomeiwen.com/subject/hnocmktx.html
网友评论