Hi I am obviously new to c++. I can't figure out how you type in the boolean operator "or." Which keys is it on the keyboard???
Printable View
Hi I am obviously new to c++. I can't figure out how you type in the boolean operator "or." Which keys is it on the keyboard???
Depends on your keyboard layout, which in turn depends on which "language" the keyboard is set up to use.
You can get the same "character" by holding down ALT and typing 124 on the numeric part of the keyboard.
--
Mats
The operator is ||. The character you are looking for is the vertical bar. I have used Russian, Hebrew, and US keyboards and on all of those, the symbol is on the same key as backslash. I don't know about other keyboards.
Or, you can simply use the word "or" which means the same thing, in C++ only.
Use two pipe characters: ||
On a standard US keyboard it's usually shift + '\' above the enter key.
If your keyboard doesn't have a | key, you could always include <ciso646> and use "or" instead of "||".
http://en.wikipedia.org/wiki/Iso646.h
On a German keyboard, you get the key using AltGr+<.
I have no idea. The header seems completely redundant. A check of the MinGW port of g++ 3.4.5 reveals a <ciso646> header file that consists entirely of comments.Quote:
Then why would they bother having a <ciso646> for us to include to begin with?
Well, those words are keywords already under the current C++ standard. The header is in fact part of the C95 standard that got added to C++ in 98 for reasons of consistency. There is indeed no need to add it under C++.
thank you, that is what I was looking for!
. . . or use trigraphs, though you'd probably have to enable them in your compiler options first.
But don't use trigraphs unless you have to, because they can cause problems and look weird. :)
[edit]I was going to mention that too . . . C95 was what the standard used to be called when no one knew when the standard would actually finalize, AFAIK. It's generally called C99 now. [/edit]Quote:
> C95
You mean C99?
That's it then. Thanks for the correction. I had it edited from C99 to C95 when I saw the copyright on my header file. Didn't know C95 was just a moniker.
Hmm ... isn't C95 like C++03, the date of a technical corrigendum?
It's possible yes because I do remember reading somewhere about iso646.h being added to the standard about that time - and not by C99 as the wikipedia article provided by cpjust reads.
My memory is not to be trusted though. However, gcc iso646.h copyright is dated 1997
EDIT: just confirmed with the cvs (old-gcc) and the file there is 12 years and 8 months old, dated June, 15 1995.