stdin question

This is a discussion on stdin question within the C Programming forums, part of the General Programming Boards category; Is there a way to check for a newline in stdin without getting rid of the newline? If there isnt ...

  1. #1
    .........
    Join Date
    Nov 2002
    Posts
    303

    stdin question

    Is there a way to check for a newline in stdin without getting rid of the newline? If there isnt can you write to stdin like with a function? I tryed fputc and it didn't work to well so Im assuming you can't. Anyone know for sure?

  2. #2
    .........
    Join Date
    Nov 2002
    Posts
    303
    Hey thanks for the reply. Yea you guessed it I was trying to use scanf to read a number and validate it without removing the newline but I couldn't figure it out, so I ended up using fgets which works great. I'll have to look into nonblocking file descriptors and select thanks.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. another do while question
    By kbpsu in forum C++ Programming
    Replies: 3
    Last Post: 03-23-2009, 01:14 PM
  2. stdin question
    By audinue in forum C Programming
    Replies: 12
    Last Post: 01-11-2009, 02:57 AM
  3. struct question part 2
    By ronin in forum C Programming
    Replies: 4
    Last Post: 06-23-2003, 06:09 PM
  4. opengl DC question
    By SAMSAM in forum Game Programming
    Replies: 6
    Last Post: 02-26-2003, 09:22 PM
  5. stdin question
    By oomen3 in forum C Programming
    Replies: 6
    Last Post: 02-19-2003, 02:52 PM

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