problem w/ doubles in friend's program

This is a discussion on problem w/ doubles in friend's program within the C Programming forums, part of the General Programming Boards category; Originally Posted by mkylman Um...what? I've really got no knowledge of this anymore, I definitely need to spend time relearning ...

  1. #16
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,484
    Quote Originally Posted by mkylman View Post


    Um...what? I've really got no knowledge of this anymore, I definitely need to spend time relearning this >.<
    if user inputs something like "blablabla" scanf will not be able to convert it to int- so the string will be left in the input buffer as is.
    if you use continue and do nothing to the input buffer next iteration will try to read the same string and will fail as well

    you need to get rid of the "blablabla" string before asking user to enter something else. REad FAQ how to do it

    FAQ > How do I... (Level 2) > Flush the input buffer
    The first 90% of a project takes 90% of the time,
    the last 10% takes the other 90% of the time.

  2. #17
    Registered User
    Join Date
    Aug 2006
    Posts
    62
    Okay I get it now. Thanks a ton man, this is more useful than you know!

    MKylman

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Client-server system with input from separate program
    By robot-ic in forum Networking/Device Communication
    Replies: 3
    Last Post: 01-16-2009, 02:30 PM
  2. Multi Thread Program Problem
    By ZNez in forum C Programming
    Replies: 1
    Last Post: 01-03-2009, 10:10 AM
  3. I have finished my program, one problem
    By sloopy in forum C Programming
    Replies: 4
    Last Post: 11-29-2005, 01:10 AM
  4. Some Problem With My Program
    By Americano in forum C Programming
    Replies: 5
    Last Post: 10-18-2003, 01:58 AM
  5. Problem with Program not Quitting
    By Unregistered in forum Windows Programming
    Replies: 20
    Last Post: 06-11-2002, 11:06 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21