View Single Post
Join Date: Mar 2004
Posts: 77
Reputation: infamous is an unknown quantity at this point 
Solved Threads: 2
infamous infamous is offline Offline
Junior Poster in Training

Re: error checking help

 
0
  #2
Mar 23rd, 2004
u are almost there. the scanf function returns teh number of correctly read variables. in your while loop, u are testing:
while ((amt <= (float) 100) && (correctItemsRead == 1));

but actually it should be:
while ((amt <= (float) 100) && (correctItemsRead != 1));

when it returns 1, u want to break out of the loop, not the other way around.
Reply With Quote