Solved

Entering statements on the keyboard

Posted on 2001-09-16
9
275 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
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.

 
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

623 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