Click here to Skip to main content
16,004,828 members
Home / Discussions / C#
   

C#

 
Generalwhy use | instead of || and same with & and && Pin
Xmen Real 20-Feb-08 18:06
professional Xmen Real 20-Feb-08 18:06 
GeneralRe: why use | instead of || and same with & and && Pin
mav.northwind20-Feb-08 19:27
mav.northwind20-Feb-08 19:27 
GeneralRe: why use | instead of || and same with & and && Pin
darkelv20-Feb-08 19:34
darkelv20-Feb-08 19:34 
GeneralRe: why use | instead of || and same with & and && Pin
Xmen Real 21-Feb-08 2:50
professional Xmen Real 21-Feb-08 2:50 
GeneralRe: why use | instead of || and same with & and && Pin
darkelv21-Feb-08 3:16
darkelv21-Feb-08 3:16 
GeneralRe: why use | instead of || and same with & and && Pin
John Oxley20-Feb-08 23:39
John Oxley20-Feb-08 23:39 
GeneralRe: why use | instead of || and same with & and && Pin
Xmen Real 21-Feb-08 2:37
professional Xmen Real 21-Feb-08 2:37 
GeneralRe: why use | instead of || and same with & and && Pin
Dan Neely21-Feb-08 2:59
Dan Neely21-Feb-08 2:59 
Xmen wrote:
so why we uses | to decrease our performance?




| and & are not intended for use as logical operators although they can be (ab)used as such. They're intended for bitwise operations.

x = 6 | 3; <br />
//x = 7<br />
//  110<br />
//| 011<br />
//= 111<br />
<br />
x = 6 & 3; <br />
//x = 2<br />
//  110<br />
//| 011<br />
//= 010<br />


Otherwise [Microsoft is] toast in the long term no matter how much money they've got. They would be already if the Linux community didn't have it's head so firmly up it's own command line buffer that it looks like taking 15 years to find the desktop.
-- Matthew Faithfull

GeneralRe: why use | instead of || and same with & and && Pin
John Oxley21-Feb-08 4:46
John Oxley21-Feb-08 4:46 
GeneralRe: why use | instead of || and same with & and && Pin
Xmen Real 21-Feb-08 5:04
professional Xmen Real 21-Feb-08 5:04 
GeneralRe: why use | instead of || and same with & and && Pin
PIEBALDconsult21-Feb-08 5:51
mvePIEBALDconsult21-Feb-08 5:51 
GeneralCompletely OT: why use | instead of || and same with & and && Pin
John Oxley21-Feb-08 9:46
John Oxley21-Feb-08 9:46 
GeneralRe: Completely OT: why use | instead of || and same with & and && Pin
PIEBALDconsult21-Feb-08 12:09
mvePIEBALDconsult21-Feb-08 12:09 
QuestionProblem with faxcomlib.dll while sending pdf file as fax thru c#.net application Pin
saikiran20-Feb-08 17:44
saikiran20-Feb-08 17:44 
QuestionGUI items disabled? Pin
rakanishuu20-Feb-08 17:35
rakanishuu20-Feb-08 17:35 
AnswerRe: GUI items disabled? Pin
Vikram A Punathambekar20-Feb-08 17:44
Vikram A Punathambekar20-Feb-08 17:44 
GeneralRe: GUI items disabled? [modified] Pin
rakanishuu20-Feb-08 18:05
rakanishuu20-Feb-08 18:05 
GeneralTyped factories in C#3 Pin
Roger Alsing20-Feb-08 15:33
Roger Alsing20-Feb-08 15:33 
GeneralAccessing a object created in Form1 trough Form2 Pin
Stigern2k34k20-Feb-08 14:47
Stigern2k34k20-Feb-08 14:47 
GeneralRe: Accessing a object created in Form1 trough Form2 Pin
Pete O'Hanlon21-Feb-08 2:51
mvePete O'Hanlon21-Feb-08 2:51 
GeneralBitwise and, or, xor with doubles. Pin
PhilDanger20-Feb-08 13:44
PhilDanger20-Feb-08 13:44 
GeneralRe: Bitwise and, or, xor with doubles. Pin
Christian Graus20-Feb-08 13:53
protectorChristian Graus20-Feb-08 13:53 
GeneralRe: Bitwise and, or, xor with doubles. Pin
PhilDanger20-Feb-08 14:04
PhilDanger20-Feb-08 14:04 
GeneralRe: Bitwise and, or, xor with doubles. Pin
TheGreatAndPowerfulOz20-Feb-08 14:09
TheGreatAndPowerfulOz20-Feb-08 14:09 
GeneralRe: Bitwise and, or, xor with doubles. Pin
TheGreatAndPowerfulOz20-Feb-08 14:08
TheGreatAndPowerfulOz20-Feb-08 14:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.