-
AND OR and NOT
I have been programming in C++ for several years now. However, somewhere along the line, I missed precisely what these do. Having done some assembly, I am aware of their low-level uses. Does C++ use them for soemthing else, or is it the same? I see people using them in if statements, ect. and I would really like to know what they are using them for. Thank you for your time! If it is too much trouble to explain it, I would be just as happy to get a link! Thanks! ^_^ :)
-
& | ~ ^ (AND OR NOT XOR) are all low-level bitwise operations in C++, just as they are in assembly. Its && || and ! which are the logical operations, and not the bitwise.
-
If X is True, (non zero) any Y is True then (X && Y) is True, if either is False, (zero), then (X && Y) is False. Boolean AND operation, as you say, often used in if() statements.
If either X or Y is True, then (X || Y) is True, if both are False (X || Y) is False. Boolean OR operation, again used in if() statements amongst other things.
If X is True, then (!X) is False, boolean NOT operation.
That what you mean? Or was it bitwise operations?
-
Thank you both for your replies. I now understand what I did not before! I really apperciate it! ^_^