b***k 发帖数: 2673 | 1 ☆─────────────────────────────────────☆
dudu1688 (dudu) 于 (Wed Mar 12 21:35:13 2008) 提到:
int _tmain(int argc, _TCHAR* argv[])
{int x=3, y=6;
cout<<(x&y)<
cout<<(x|y)<
return 0;
}
程序跑出来,输出结果是2 和7, 看不明白,请高人指点, 多谢。
☆─────────────────────────────────────☆
gnay (囦囩团囝) 于 (Wed Mar 12 21:52:08 2008) 提到:
& and | are bit operator.
in binary, x is 011, y is 110
011
&
110
=
010 = 2
011
|
110
=
111 = 7
☆─────────────────────────────────────☆
jpbr (追梦人) 于 (Wed Mar 12 21:52:57 200 |
|