Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Entering statements on the keyboard

Posted on 2001-09-16
9
Medium Priority
?
279 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
  • 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 400 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Article by: evilrix
Looking for a way to avoid searching through large data sets for data that doesn't exist? A Bloom Filter might be what you need. This data structure is a probabilistic filter that allows you to avoid unnecessary searches when you know the data defin…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
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.

885 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