TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: FRANK MASINGILL
from: TOM TORFS
date: 1998-02-14 14:42:00
subject: Boolean logic

Frank Masingill wrote in a message to All:
 FM>    int IWantTo, IDontWantTo;
 FM>    IWantTo = 0; IDontWantTo = 1;
What's the purpose of having two different variables for this ? You should 
check for IDontWantTo as !IWantTo (or vice versa of course).
 FM>    if(IWantTo)
 FM>    {
 FM>       cout << IWantTo << endl;
 FM>       return IWantTo;
 FM>    }
 FM>    else
 FM>    if(IDontWantTo)
And change this to a simple else.
 FM>    {
 FM>       cout << IDontWantTo << endl;
 FM>       return IDontWantTo;
 FM>    }
 FM> }
greetings,
Tom
tomtorfs@village.uunet.be
--- timEd/2 1.10+
---------------
* Origin: 80X86 BBS 32-15-24.62.32 V.34/V.FC (24h/24h) (2:292/516)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.