Mail Archives: djgpp/2001/10/18/10:04:06
"Traveler" <traveler AT netti DOT fi> wrote in news:9qmkrh$581$1 AT tron DOT sci DOT fi:
> Little example...
>
> int x = 10,
> y = 10;
>
> if(x == 10 && x == 10) // Does this look scary or weird to you ?
> cout << "true\n";
> else
> cout << "false\n";
This message is completely off-topic in this newsgroup. Further, what you
describe has already been tried by a whole bunch of hapless people and
rejected. If you want to use EQUAL for ==, then you should not be using C.
(See C faq 10.2 at http://www.faqs.org/faqs/C-faq/faq/).
<snip>
> #define AND &
> #define COMPLEMENT ~
> #define EQUAL =
> #define EQU EQUAL
> #define NOT !
> #define OR |
> #define XOR ^
>
> As you can see the things "AND" & "OR" defined here are "bit" operators
> not "logical" operators. However, there really is no difference
> becourse you can use these two just as easily in "if" statement´s as in
> bit manipulation.
the point is, if you want a logical operation, use the logical operator.
OTOH, if you want a bitwise operation, use the bitwise operator.
Sinan.
--
--------------------------------
A. Sinan Unur
http://www.unur.com/
- Raw text -