| | |
How to type logical or
Thread Solved |
If you don't mean the logical OR operator in C, example follows, then you need to be more specific about what exactly you want to do.
c Syntax (Toggle Plain Text)
#include <stdio.h> int main ( void ) { if ( 0 || 1 ) /* || is the logical OR operator */ puts ( "True" ); else puts ( "False" ); return 0; }
Last edited by Narue; Dec 12th, 2008 at 9:24 am.
I'm here to prove you wrong.
>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:
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.
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:
c Syntax (Toggle Plain Text)
#include <stdio.h> int main ( void ) { if ( 0 ??!??! 1 ) puts ( "True" ); else puts ( "False" ); return 0; }
C Syntax (Toggle Plain Text)
??> } ??< { ??) ] ??( [ ??= # ??! | ??/ \ ??' ^ ??- ~
Last edited by Narue; Dec 12th, 2008 at 10:47 am.
I'm here to prove you wrong.
![]() |
Similar Threads
- Problem with logical and (&) (C#)
- Data Type and hanging issues (C++)
- illegal start of expression & type (Java)
- Personality test! (Geeks' Lounge)
- plz! trubleshoot my program (C++)
- find files of certain type... (Assembly)
- C++ enumerated data type help (C++)
- logical error (displaying words in order of length) (C++)
- Having trouble passing bool type to function....need help (C++)
Other Threads in the C Forum
- Previous Thread: Read Hardware Information
- Next Thread: Problem with Printf
| Thread Tools | Search this Thread |
adobe api array arrays binarysearch calculate char cm convert copyanyfile copypdffile cprogramme createcopyoffile createprocess() csyntax directory dynamic feet fflush file floatingpointvalidation fork forloop frequency getlasterror givemetehcodez global graphics gtkgcurlcompiling hacking hardware highest homework i/o inches incrementoperators intmain() iso kernel kilometer km linked linkedlist linux linuxsegmentationfault list locate logical_drives loopinsideloop. match matrix microsoft motherboard mqqueue mysql oddnumber odf open opendocumentformat opensource openwebfoundation owf pattern pdf performance pointer posix power probleminc program programming pyramidusingturboccodes read recursion recv recvblocked repetition research scanf scheduling segmentationfault send shape socketprograming socketprogramming stack standard strchr string suggestions systemcall test unix urboc user variable voidmain() wab win32api windows.h






