I get it now. I quoted the wrong person in my original post. I had meant to quote the original poster, not you. Not sure how I did that. Sorry if you took offense.
Printable View
Try replacing your "pluses" with "narrow beams". :rolleyes:
:rolleyes:Code:#include <stdio.h>
int main(void)
{
printf("2 + 2 = %d\n", 2 + 2);
return 0;
}
You're annoying me just fyi.
Code:#include <iostream>
int main()
{
std::cout << "5 + 7 = " << (5+7) << "\n\n";
std::cout << "5 | 7 = " << (5|7) << "\n\n";
std::cout << "5 - 7 = " << (5-7) << "\n\n";
std::cout << "5 &~ 7 = " << (5&~7) << "\n\n";
}
>> You're annoying me just fyi.
<homer>Woo Hoo!!!</homer>
lol, oh damn, i wanted to know what the technical term for the '|' was, and when I typed it in to google, the page went blank!?! ...gah, it won't return any results at all.
I guess it's a 'bar'... ?
my friend says 'pipe', cool. alright.
I believe the technical name is "vertical bar".
Pipe is what it's used for when chaining commands together in a shell/command prompt, e.g. find -name "*.c"|xargs grep printf|wc -l, which will show how many lines of "printf" there are in the .c files recursively the current directory.
--
Mats
See Wikipedia for the name:
I use vertical bar, and I'll understand you if you said pipe. (I'd give you odd looks for "Sheffer stroke" though.) "vertical bar" would probably be the most understood.Quote:
The name of the character (|) is the Sheffer stroke, though often referred to as a pipe (by the Unix community) and Vertical bar, verti-bar, vertical line or divider line by others.
Broken bar (¦) is a separate character.
Although if you're dealing with code, you might want to use the name of the operation (binary OR) and not "vertical bar".
Having just taken a Unix Programming course and learned how cool pipes are, I now refer to it as a pipe, even though it's not.
One is a addition operator and one is a bitwise or operator, quite different by any opinion.
Heh. Not a very good title for a thread eh?
I've also noticed that '*' = '+', lol
for example
yet, if I replace + with *,Code:2 + 2 = 4
OMG!Code:2 * 2 = 4
</sarcasm>
bitwise operators == logical operators which are the fundamental bases to mathematical operations (in computing)!
| = OR
& = AND
! = NOT
^ = XOR
They can be mixed and mingled to create all operations in mathematics, and physically* are. If you learn some engineering you'll see all mathematics, multiplication, division, etc etc are logical operations!
examples:
T | F = T
T & F = F
!T = F
T ^ F = T
(you can substitute T = 1, and F = 0)
http://en.wikipedia.org/wiki/AND
http://en.wikipedia.org/wiki/OR
http://en.wikipedia.org/wiki/XOR
http://en.wikipedia.org/wiki/NOT_gate
there's more, like NAND and such... which -all- can be mimic'd with c++ operators, and all can perform multiplication and all other mathematical operations.
while they themselves are -not- identical, they can perform identical functions. and do. there *really* is no such thing as '+' (plus) or '-' (minus), or any other of the 'higher level operations'.... go ahead and research it.
http://books.google.com/books?id=kGu...foqMCjepD-QgPM
happy now?
Yes!