Solved

Entering statements on the keyboard

Posted on 2001-09-16
9
274 Views
Last Modified: 2012-05-04
How do I enter the logical OR symbols on the keyboard and where are they located?
0
Comment
Question by:Daaber40
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +2
9 Comments
 
LVL 6

Expert Comment

by:zebada
ID: 6486158
Called the "pipe" symbol, it is usually located on the same key as the backslash character: \
Usually on the right hand side of the keyboard.
You need to hold down the shift key while pressing the backslash key.
Sometimes the symbolon the keybaord looks like two small vertical lines, one on top of the other.
0
 
LVL 6

Expert Comment

by:Triskelion
ID: 6486381
Different fonts will make the pipe look different, however, zebada is correct.

if ((iThis >= iThat) || (iThat>= iTheOtherThing))
{
   //Do something here.
}

On my browser, those look like solid lines, however, on the command line, they look like double vertical dashes.
0
 
LVL 22

Accepted Solution

by:
nietod earned 100 total points
ID: 6487207
Note that not all computers/character sets even contain the logical or (|) symbol.  This is especially true for systems for non-english languages.   To get around this problem C++ supports tri-graphs.  These are 3 letter sequences that represent symbols that are often not supported natively.  For example, the trigraph for a single pipe character (bitwise or) or is "??!".  A pair of these trigraphs produces a pair of the symbols, which forms a logical or operator.  So you can write

if (onthing ??!??! another)

instead of

if (onthing || another)
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 6

Expert Comment

by:Triskelion
ID: 6487445
Good catch, nietod!
0
 
LVL 6

Expert Comment

by:zebada
ID: 6488963
How do you remember that stuff Nietod? Now that you mention it I recall somewhere in the dim dark days of programming on (very) non-standard keyboards I had to do that as well. But I had long ago forgotten about tri-graphs.
0
 
LVL 6

Expert Comment

by:zebada
ID: 6488966
Nietod, do you have a list of tri-graphs? It would make for a great obsfucated piece of code :))
0
 
LVL 22

Expert Comment

by:nietod
ID: 6489007

trigraph     replacement     trigraph     replacement     trigraph     replacement
??=     #     ??(     [     ??<     {
??/     \     ??)     ]     ??>     }
??'     ^     ??!     |     ??-     ~

That table seems to be missing the ??? trigraph which is replaced with a ?.
0
 
LVL 11

Expert Comment

by:griessh
ID: 6868143
I think you forgot this question. I will ask Community Support to close it unless you finalize it within 7 days. Unless there is objection or further activity,  I will suggest to accept "nietod" comment(s) as an answer.

If you think your question was not answered at all, you can post a request in Community support (please include this link) to refund your points.
The link to the Community Support area is: http://www.experts-exchange.com/commspt

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
======
Werner
0
 
LVL 5

Expert Comment

by:Netminder
ID: 6889927
Per recommendation, force-accepted by
Netminder
CS Moderator

Experts: please check for "Points For" questions -- there are a bunch in this TA.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question