在vc中,经常有种数据类型;“bool”----是什么意思?

jieke2002 2002-04-23 08:06:38
在vc中,经常有种数据类型;“bool”----是什么意思?
...全文
449 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
fhbkyo 2002-04-23
  • 打赏
  • 举报
回复
不会吧,还有人问这问题???
我眼睛应该没问题的!!
BOOL 的返回值是 TRUE AND FALSE
用来判断某表达式的真假,其他的他们也都说了
lvxn_sina 2002-04-23
  • 打赏
  • 举报
回复
慢,好象不对啊!: 111222(www.mozilla.org)
因该是#define BOOL int吧?!

不过其实用的是
typedef int BOOL;
qiuanhong 2002-04-23
  • 打赏
  • 举报
回复
呵~~~~~~~~~~~楼上都说了
寂寞漂泊 2002-04-23
  • 打赏
  • 举报
回复
都说完了
lvxn_sina 2002-04-23
  • 打赏
  • 举报
回复
哈哈~~~~~~~~~~~~~

有意思!

不过
#define int bool
是错的!因为在VC中bool是关键字,新加的数据类型!
111222 2002-04-23
  • 打赏
  • 举报
回复
#define int BOOL
#define int bool
#define 1 TRUE
#define 1 true
#define 0 FALSE
#define 0 false
yu_hl 2002-04-23
  • 打赏
  • 举报
回复
C++ Specific :
This keyword is an integral type. A variable of this type can have values true and false.
The bool type participates in integral promotions. An r-value of type bool can be converted to an r-value of type int, with false becoming zero and true becoming one.

Microsoft Specific:
In Visual C++4.2, the Standard C++ header files contained a typedef that equated bool with int. In Visual C++ 5.0 and later, bool is implemented as a built-in type with a size of 1 byte. That means that for Visual C++ 4.2, a call of sizeof(bool) yields 4, while in Visual C++ 5.0 and later, the same call yields 1. This can cause memory corruption problems .
kingofvc 2002-04-23
  • 打赏
  • 举报
回复
true false
两种状态的布尔型变量
看c++语法

16,472

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • Web++
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧