Solved

Entering statements on the keyboard

Posted on 2001-09-16
9
271 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 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
 
LVL 6

Expert Comment

by:Triskelion
ID: 6487445
Good catch, nietod!
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
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 member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

863 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now