|
[求助]按位操作疑问
是啊 |
|
[求助]按位操作疑问
谢谢。终于有些开窍了。我的理解: 程序转化下看着方便: int a =5, b = 4, c =5; // b是一个标志,a和c 任意初始化 if( a & b) c |= b; 这样理解: 根据源程序上下文,其中b 是一个结构体的成员,这个成员用来作为结构体的一个标志。b的二进制为:00000100。 实际上b右数第三位的1就是这个标志位,也就是十进制的标志。 if(a & b) //如果a & b为非0,也就是当a的标志位(右数第三位)为1,则该条件成立。 c = c | b; // c | b 这句按位或,也就是将c 的标志位(右数第三位)设置成1,其他位不变。 也就是只看二进制位有没有标志位1,若有,则该变量有这个标志;否则,则没有标志。 不知表达清楚没有。 |
|
[求助]按位操作疑问
嗯。就是不明白其中的逻辑意义,如何理解 if 语句这段代码 ? |
|
[求助]按位操作疑问
DO_BUFFERED_IO = 0x00000004 ,二进制也就是0100。 若harddiskobj->Flags是十进制5,也就是0101。 那 harddiskobj->Flags & DO_BUFFERED_IO 结果为0100,也就是4,结果非0。 此时那也就是说harddiskobj->Flags有DO_BUFFERED_IO标志位? 转不过来弯。 |
|
[求助]按位操作疑问
把那句代码转换下: int a= 16, b=4, c = 0; // if( a&b ) c |= b; 这个if 语句的逻辑含义是什么呢? 不需解释& 或 | 的含义,这个清楚。 |
|
[求助]Win32 Application
收到, 谢谢! |
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值