1
if (NUM % 2)是什么意思不明白。
防止与原有的代码中的bool或者Bool冲突?
很棒很棒
好有道理
鱼哥牛!!
{:10_256:}
为什么可以直接用true\false来直接表示1/0呀,还有就是bool isOdd这个定义为什么可以这么写?
啊对对对
{:5_108:}
看了外网上的回答,几乎和小甲鱼说的一模一样,不愧是小甲鱼!
C did not originally have a Boolean type, it was added in the 1999 version of the language (C99). At that point, C++ was already standardized (in 1998) to use the type bool, with keywords false and true. To keep the C Boolean type separate from the one in C++, as well as preventing the new name from breaking old C code, it was named _Bool。
C语言原本并没有布尔型,布尔型在C99版中被加入到C语言中。在那个时候,C++已经被标准化,使用bool类型和false、true关键字。为了使C语言的布尔型和C++的布尔型区分开来,并为了防止新的名字使原有的C语言代码崩溃,于是它被叫做_Bool,至于为什么是下划线和开头字母大写,就和小甲鱼说的一模一样了。
看不懂,是不是没救了
我直接用1 0 不就行了吗{:5_99:}
good
懂了
666{:5_106:}
6666666666666
#include <stdio.h>
#define _Bool int
int main()
{
printf("_Bool's length is %d\n", sizeof(_Bool));
return 0;
}
可是我复制到vscode输出显示让我换成printf("_Bool's length is %lu\n", sizeof(_Bool));
问:这是为什么呢?格式字符串%l是什么意思
分析的头头是道呢
{:10_257:}