Solved

Entering statements on the keyboard

Posted on 2001-09-16
9
270 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Good catch, nietod!
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 6

Expert Comment

by:zebada
Comment Utility
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
Comment Utility
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
Comment Utility

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
Comment Utility
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
Comment Utility
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
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.

744 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

11 Experts available now in Live!

Get 1:1 Help Now