Date
Sep. 8th, 2024
 
2024年 8月 6日

Post: C++ Primer 004 : bool 类型

C++ Primer 004 : bool 类型

Published 12:05 May 22, 2013.

Created by @ezra. Categorized in #Programming, and tagged as #C/C++.

Source format: Markdown

Table of Content

本篇主要介绍C++ 中的 bool 类型。

bool类型

bool 类型用来表示逻辑值,它只有两个值: true1false,我们可以通过函数 boolalpha 来将 bool 值显示为 truefalse 字面值。

bool 类型可以定义变量,也可以定义指针,可以作为函数的参数,也可以作为函数的返回值。

回顾 C 语言中的知识,取值为 00.0NULL\0 均可以表示为假。

Pinned Message
HOTODOGO
The Founder and CEO of Infeca Technology.
Developer, Designer, Blogger.
Big fan of Apple, Love of colour.
Feel free to contact me.
反曲点科技创始人和首席执行官。
程序猿、设计师、奇怪的博主。
苹果死忠、热爱色彩斑斓的世界。
如有意向请随时 与我联系