|
发表于 2022-1-6 16:21:13
|
显示全部楼层
看了外网上的回答,几乎和小甲鱼说的一模一样,不愧是小甲鱼!
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,至于为什么是下划线和开头字母大写,就和小甲鱼说的一模一样了。 |
|