How to type logical or

Thread Solved

Join Date: Nov 2008
Posts: 3
Reputation: GrahamShaw2008 is an unknown quantity at this point 
Solved Threads: 0
GrahamShaw2008 GrahamShaw2008 is offline Offline
Newbie Poster

How to type logical or

 
0
  #1
Dec 12th, 2008
Where do I locate the logical or on my keyboard? Thanks for your help in advance.
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,614
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 713
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Code Goddess

Re: How to type logical or

 
0
  #2
Dec 12th, 2008
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.
  1. #include <stdio.h>
  2.  
  3. int main ( void )
  4. {
  5. if ( 0 || 1 ) /* || is the logical OR operator */
  6. puts ( "True" );
  7. else
  8. puts ( "False" );
  9.  
  10. return 0;
  11. }
Last edited by Narue; Dec 12th, 2008 at 9:24 am.
I'm here to prove you wrong.
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 3
Reputation: GrahamShaw2008 is an unknown quantity at this point 
Solved Threads: 0
GrahamShaw2008 GrahamShaw2008 is offline Offline
Newbie Poster

Re: How to type logical or

 
0
  #3
Dec 12th, 2008
Hi,

How do i type (||). In this case I used copy and paste. I cant find it on my keyboard.

Thanks
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 13
Reputation: gautam610 has a little shameless behaviour in the past 
Solved Threads: 3
gautam610 gautam610 is offline Offline
Newbie Poster

Re: How to type logical or

 
0
  #4
Dec 12th, 2008
It's above the Enter key on your keyboard with '\' symbol.....................
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,614
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 713
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Code Goddess

Re: How to type logical or

 
0
  #5
Dec 12th, 2008
>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:
  1. #include <stdio.h>
  2.  
  3. int main ( void )
  4. {
  5. if ( 0 ??!??! 1 )
  6. puts ( "True" );
  7. else
  8. puts ( "False" );
  9.  
  10. return 0;
  11. }
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:
  1. ??> }
  2. ??< {
  3. ??) ]
  4. ??( [
  5. ??= #
  6. ??! |
  7. ??/ \
  8. ??' ^
  9. ??- ~
  10.  
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.
I'm here to prove you wrong.
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 3
Reputation: GrahamShaw2008 is an unknown quantity at this point 
Solved Threads: 0
GrahamShaw2008 GrahamShaw2008 is offline Offline
Newbie Poster

Re: How to type logical or

 
0
  #6
Dec 12th, 2008
Thanks, so simple. My keyboard displays ¦, however prints correct |.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC