TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: FRANK MASINGILL
from: DANIEL LYNES
date: 1998-03-01 19:19:00
subject: Boolean logic

 -=> Quoting Frank Masingill to All <=-
 FM> Something's obviously wrong with the program below.  You
 FM> programmers can, I'm sure figure what I'm trying to learn.  Will you
 FM> straighten it up for me? Thanks.
 FM> if(IDontWantTo)
 FM> {
 FM> cout << IDontWantTo << endl;
 FM> return IDontWantTo;
 FM> }
 FM> }
The code as you have presented it, only has one error, which will merely
generate a warning.  That being, that you do not have a default return
value.  However, as I've said, that will only generate a warning; it will
not generate an error.  An object module will still be created.
As for the program's purpose, it seems to be somewhat meaningless; it
doesn't do anything, and the first conditional block will also generate an
'unreachable code' warning, as it will never be executed under any
circumstances; IWantTo is always false.
ttfn.
... The OFFICIAL tagline of the 1996 Olympics!
--- Blue Wave/DOS v2.30 [NR]
---------------
* Origin: The Eclectic Lab (1:153/831)

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™.