Sunday, August 2, 2009

When regarding to programming using the C language, what do absolute value bars symbolize?

Thanks! All input is greatly appreciated! =)

When regarding to programming using the C language, what do absolute value bars symbolize?
Do you mean this? ||





That is the logical "or" operator, counterpart to the logical "and" operator: %26amp;%26amp;.





You can use it in "if" statements, among other places. Such as:





int i = 5;


if( i%26lt;10 || i==15 )


{


//"i" is less than 10 or "i" equals 15


}





There are also bitwise "or" and "and" operators: | and %26amp;.





Some more info, especially on the difference between "bitwise" and "logical":


http://en.wikipedia.org/wiki/Bitwise_OR#...


http://en.wikipedia.org/wiki/Logical_or#...


No comments:

Post a Comment