| | |
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 |
#include adobe ansi api array asterisks binarysearch changingto char character cm copyimagefile cprogramme creafecopyofanytypeoffileinc createcopyoffile csyntax database directory dynamic execv feet fgets file fork forloop frequency function getlasterror givemetehcodez global grade graphics gtkgcurlcompiling hacking hardware highest histogram i/o include incrementoperators infiniteloop input interest kernel keyboard kilometer license linked linkedlist linux linuxsegmentationfault list locate logical_drives looping loopinsideloop. lowest match matrix meter microsoft motherboard mqqueue mysql number odf opensource owf pattern pdf performance pointer posix probleminc process program programming radix recursion recv repetition research reversing scanf segmentationfault sequential shape socket socketprograming standard string systemcall threads turboc unix user voidmain() wab windows.h windowsapi






