Thread: flushing stdin

  1. #1
    Registered User
    Join Date
    Apr 2006
    Posts
    31

    flushing stdin

    on linux, would it be safe to open /dev/null as a regular file for write only to flush stdin? or is there another way to do it?

  2. #2
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    Posts
    5,005
    7. It is easier to write an incorrect program than understand a correct one.
    40. There are two ways to write error-free programs; only the third one works.*

  3. #3
    Registered User
    Join Date
    Apr 2006
    Posts
    31
    thanks.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Flushing buffer
    By $l4xklynx in forum C Programming
    Replies: 6
    Last Post: 03-04-2009, 10:07 PM
  2. Another syntax error
    By caldeira in forum C Programming
    Replies: 31
    Last Post: 09-05-2008, 01:01 AM
  3. flushing stdin
    By crash88 in forum C Programming
    Replies: 2
    Last Post: 06-29-2006, 02:23 PM
  4. flushing stdin
    By crash88 in forum Linux Programming
    Replies: 1
    Last Post: 05-18-2006, 01:21 AM
  5. stdin question
    By oomen3 in forum C Programming
    Replies: 6
    Last Post: 02-19-2003, 02:52 PM