Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C++ and,or,not,xor keywords [duplicate]

Tags:

c++

operators

Possible Duplicate:
The written versions of the logical operators.

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?

like image 444
uray Avatar asked Mar 06 '10 18:03

uray


1 Answers

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 they used keyboard with no &, |, or ^ (etc.).

Nowadays when QWERTY is a standard (with AZWERTY & co. as variations) it is no longer an issue.

PS. And of course for obfuscation code competitions ;)

like image 187
Maciej Piechotka Avatar answered Oct 01 '22 06:10

Maciej Piechotka