bool + str
来源:互联网 发布:苹果cms 仿08影院模板 编辑:程序博客网 时间:2024/06/07 04:51
在里面竟然还有个 true 和 flase, 而且竟然还可以和字符串相加,真是奇怪了
#include <stdio.h>#include <stdbool.h>int main(){ char strtrue, strfalse; true; false; strtrue = '0' + true; strfalse = '0' + false; printf("%c, %d\n", strtrue, strtrue); printf("%c, %d", strfalse, strfalse);}
[root@host-172-16-32-99 ~]# gcc boolplus.c && ./a.out1, 490, 48
后面看了下为什么可以,原来 bool 在原本的c语言是没有的,后期实现是通过宏定义来实现的
typedefenum __bool {false = 0,true =1, }bool;
阅读全文
0 0
- bool + str
- python str转bool方法
- void CXX::OutputMsg01(CString tag, CString str, BOOL clean)
- 5、内置函数chr、ord、bool、int、float、str使用方法
- BOOL
- bool
- bool
- bool
- bool
- BOOL
- bool
- Bool
- BOOL
- bool
- 判断是否有重复字符 bool IsUniqueChars( String str) CC150 1.1
- str
- str()
- str
- BZOJ 3450 Tyvj1952 Easy
- python多线程socket编程--多客户端接入
- 跟上java8:你忽略的新特性
- [iOS] 近期发布到App Store遇到的问题
- if结构和for循环,while循环
- bool + str
- git 命令
- centos 7.2系统bug导致HGDB后台进程崩溃,数据库无法访问
- 什么是RUP?
- android杂谈
- Android屏幕适配dp、px两套解决办法
- Linux(CentOS)下设置nginx开机自动启动(2个办法)
- 安卓工具类2——json数据的快速处理方式(GsonFormat插件实现JavaBean)附findbugs插件安装使用
- liunx简单命令操作