Daniel Lemire's blog

, 2 min read

Operators and, or and xor written in English: is this standard C++?

3 thoughts on “Operators and, or and xor written in English: is this standard C++?”

  1. Ignacio says:

    Even if valid, that’s so awful methinks, besides: which operation do you mean? bitwise? logical?

  2. Anonymous says:

    These are standard in C++. If Visual C++ doesn’t accept them, it’s broken. “and” means &&, while & would be “bitand”.

  3. Duke Aaron D'Attention says:

    You should be able to use the following operators (logical then bitwise)…

    and = &&, &
    or = ||, |
    xor = ^

    …without having to include “iso646.h”. This syntax has always been part of ANSI C right from the outset; it also makes no difference which version of VC++ you are using.

    Just ensure that you start a command-line project, as opposed to a Windows-based project, in VC++. This should include the basic headers for you, and won’t bloat your code.

    Hope this helps.