当前位置:网站首页>02.1.2.逻辑类型 bool
02.1.2.逻辑类型 bool
2022-07-28 09:53:00 【vv1025】
//02.1.2.逻辑类型 bool
//c 语言的逻辑真假用 0 和非 0 来表示。而 C++中有了具体的类型,但其本质,仍是
//一个 char 类型的变量可被 0 和非 0 的数据赋值。
#include <iostream>
#include <stdio.h>
using namespace std;
int main() {
bool flag = true;
if(flag)
printf("flag is true\n");
else
printf("flag is flase\n");
printf("sizeof(flag) = %d sizeof(bool) = %d\n", sizeof(flag), sizeof(bool));
flag = 100;
printf("flag = %d\n", flag);
return 0;
}flag is true
sizeof(flag) = 1 sizeof(bool) = 1
flag = 1
-----------------------------------------------
Process returned: 0 (0x0)
Execution time: 371 ms
Maximum memory use: 276 KB
-----------------------------------------------
Press any key to continue . . .边栏推荐
- 能够遍历一个文件夹下的所有文件和子文件夹
- 【JZOF】14剪绳子
- 13 probability distributions that must be understood in deep learning
- Install lamp under deepin
- redis的基础知识
- TimeBasedRollingPolicy简介说明
- SQL server, MySQL master-slave construction, EF core read-write separation code implementation
- 3 minutes to tell you how to become a hacker | zero foundation to hacker getting started guide, you only need to master these five abilities
- 深度学习必懂的 13 种概率分布
- MySQL 为什么有时候会选错索引?
猜你喜欢
Edge团队详解如何通过磁盘缓存压缩技术提升综合性能体验

Installing MySQL for Linux operating system (centos7)
![[ESP32][esp-idf] AP+STA实现无线桥接 中转wifi信号](/img/bf/0a968064a8f7c11b86a2a2820208e6.png)
[ESP32][esp-idf] AP+STA实现无线桥接 中转wifi信号

高温天气筑牢安全生产防线,广州海珠区开展加油站应急演练

博弈论 1.Introduction(组合游戏基本概念、对抗搜索、Bash游戏、Nim游戏)

在Plato Farm新经济模型下,如何在游戏中获取更多MARK

The high temperature continues, and public transport enterprises carry out special safety training

居家健康诊断时代下,Senzo打造增强侧向流测试产品

Openatom openharmony sub forum, see you today at 14:00! Wonderful release of memorabilia attached

房地产数字化转型方案:全方位数智化系统运营,助力房企管控实效提升
随机推荐
MySQL 为什么有时候会选错索引?
Seektiger eco pass STI new progress, log in to ZB on April 14
【Gradle】This version of the JMH Gradle plugin requires Gradle 6+, you are using 6.6.
【MySQL】Got an error reading communication packets
LandingSite电子标签Quuppa固件进入DFU状态说明
JWT 登录认证 + Token 自动续期方案,写得太好了!
[OpenHarmony] [RK2206] 构建OpenHarmony编译器 (二)
Edge团队详解如何通过磁盘缓存压缩技术提升综合性能体验
Description of landingsite electronic label quppa firmware entering DFU status
How to get more marks in the game under the new economic model of Plato farm
SizeBasedTriggeringPolicy简介说明
Openatom openharmony sub forum, see you today at 14:00! Wonderful release of memorabilia attached
博弈论 1.Introduction(组合游戏基本概念、对抗搜索、Bash游戏、Nim游戏)
Data can't lie. Plato farm is the leader of the meta universe
Include and require include_ Once and require_ Once difference
Branches and loops (1)
图解 3 种主流企业架构模式(建议收藏!)
PHP 获取接口的方式
Introduction to consoleappender
office2013以上输入数学公式