Find the answer to your Linux question:
Results 1 to 4 of 4
does anybody OF ANY BUILT IN FUNCTION TO CLEAR THE INPUT BUFFER. i'm having trouble with fgets()....
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Nov 2004
    Location
    Somwhere in India
    Posts
    11

    clear the keyboard buffer


    does anybody OF ANY BUILT IN FUNCTION TO CLEAR THE INPUT BUFFER.
    i'm having trouble with fgets().

  2. #2
    Linux Guru
    Join Date
    Apr 2003
    Location
    London, UK
    Posts
    3,284
    As far as i am aware, there is no way to clear the stdin buffer, except by reading from it as using something like fgets.

  3. #3
    Linux Engineer
    Join Date
    Nov 2004
    Location
    Montreal, Canada
    Posts
    1,267
    As Jason said, I don't think either there's a automatic "buffer" cleaning method...
    Is this cause you made a prog that needs to clear the buffer?
    \"Meditative mind\'s is like a vast ocean... whatever strikes the surface, the bottom stays calm\" - Dalai Lama
    \"Competition ultimatly comes down to one thing... a loser and a winner.\" - Ugo Deschamps

  4. #4
    Just Joined!
    Join Date
    Nov 2004
    Location
    Somwhere in India
    Posts
    11
    while using fgets sometimes it does not take any input but prints something onto the screen.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •