>I cant find it on my keyboard.
Oh dear. It's the vertical bar, placed as the shift value for my backslash key, but it could be somewhere else (or not present at all) depending on the keyboard. Note that the || operator is two vertical bars, not a single key on your keyboard. If you still can't find it, you may fall into the category of C programmers that need to take advantage of C's trigraph sequences:
#include <stdio.h>
int main ( void )
{
if ( 0 ??!??! 1 )
puts ( "True" );
else
puts ( "False" );
return 0;
}
This does the same thing as my first example, except the ??! trigraph represents the vertical bar with a combination of universal characters. Here are all of the trigraphs if you discover you're missing other keys:
??> }
??< {
??) ]
??( [
??= #
??! |
??/ \
??' ^
??- ~
Before you use them, make absolutely sure that they're necessary, as trigraphs are clearly very detrimental to the readability of your code.
Last edited by Narue; Dec 12th, 2008 at 10:47 am.
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Offline 11,807 posts
since Sep 2004