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???
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
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
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+<.
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law
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.Then why would they bother having a <ciso646> for us to include to begin with?
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
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++.
Last edited by Mario F.; 02-15-2008 at 11:41 AM.
Originally Posted by brewbuck:
Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.
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]> C95
You mean C99?
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.
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.
Originally Posted by brewbuck:
Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.
Hmm ... isn't C95 like C++03, the date of a technical corrigendum?
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law
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.
Last edited by Mario F.; 02-15-2008 at 08:11 PM.
Originally Posted by brewbuck:
Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.