C ++和,或者不是,xor关键字 [英] C++ and,or,not,xor keywords
问题描述
我注意到C ++定义关键字和
,或
,不
, xor
, and_eq
, or_eq
,<$作为&&
的替代方案,可以使用c $ c> not_eq 和 xor_eq
code> || ,!
, ^
,& =
, | =
,!=
| = 。他们很少使用!怎么了?它们不是可移植的?
I notice that C++ define keyword and
, or
, not
, xor
, and_eq
, or_eq
, not_eq
and xor_eq
as an alternative to &&
, ||
, !
, ^
, &=
, |=
, !=
and |=
. and they're rarely used! What's wrong? Are they not portable?
推荐答案
它们来自C AFAIR从不知道键盘上有什么特殊符号的时候。所以有便携式语言,他们被定义,所以任何人都可以使用C,即使他使用键盘没有&
, |
或 ^
(等)。
They come from C AFAIR from times when it was not known what special symbols are on the keyboard. So to have portable language they were defined so anyone can use C even if (s)he used keyboard with no &
, |
or ^
(etc.).
现在当QWERTY是一个标准(AZWERTY& co 。作为变体),它不再是一个问题。
Nowadays when QWERTY is a standard (with AZWERTY & co. as variations) it is no longer an issue.
PS。当然,对于混淆代码竞争;)
PS. And of course for obfuscation code competitions ;)
这篇关于C ++和,或者不是,xor关键字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!