TIP: Click on subject to list as thread! ANSI
echo: cis.languages
to: SCOTT HOWELL 70270,641 (X)
from: Pete Lyall 76703,4230
date: 1990-06-26 09:29:31
subject: #4562-Help `c` problem again

#: 4652 S3/Languages
    26-Jun-90  09:29:31
Sb: #4562-Help 'c' problem again
Fm: Pete Lyall 76703,4230
To: SCOTT HOWELL 70270,641 (X)

Scott -

I'm sure you've had multiple responses at this point, but I see a couple of
things:

  a) There's a semicolon after your test condition, which in effect
     causes a 'null' statement (i.e. while(c == 'd'), do nothing -
     including not getting any other characters, so the results
     of the test never change.

  b) What is c initially? If it's a typical automatic variable,
     it could contain anything - no promises here unless it's
     a static variable. You could either shift the position
     of the getchar(), and alter the logic, or you could stuff
     a NULL or something into c so you know your starting point.

Pete

SOURCE: compuserve via textfiles.com

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