www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/10/18/10:04:06

From: "A. Sinan Unur" <asu1 AT cornell DOT edu>
Newsgroups: comp.lang.c++,comp.os.msdos.djgpp
Subject: Troll (was Re: Making C++ little easier to beginners...)
Date: 18 Oct 2001 13:51:31 GMT
Organization: Cornell University
Lines: 40
Sender: asu1 AT cornell DOT invalid (on 128.253.251.163)
Message-ID: <Xns913E6449296FFASINANUNUR@132.236.56.8>
References: <9qmkrh$581$1 AT tron DOT sci DOT fi>
NNTP-Posting-Host: 128.253.251.163
X-Trace: news01.cit.cornell.edu 1003413091 9256 128.253.251.163 (18 Oct 2001 13:51:31 GMT)
X-Complaints-To: usenet AT news01 DOT cit DOT cornell DOT edu
NNTP-Posting-Date: 18 Oct 2001 13:51:31 GMT
User-Agent: Xnews/4.06.22
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

"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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019