How can I judge the if the input is over in C language?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jzkkwei
    New Member
    • Mar 2010
    • 2

    How can I judge the if the input is over in C language?

    Now,I have a input with many lines.But I don't know it has how many lines. How can I know it when then input is over?And ,I want to do this without "scanf".If there is a function or a code like "while not eof" in Pascal?
    My English is poor,and thanks for your answer.
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    Input from where? A file? stdin?

    Comment

    • jzkkwei
      New Member
      • Mar 2010
      • 2

      #3
      Input from stdin,I'm coding for a ACM/ICPC Online Judge.

      Comment

      • Banfa
        Recognized Expert Expert
        • Feb 2006
        • 9067

        #4
        In that case you can't judge if input is over because it never is. stdin remains open for the lifetime of the program.

        You will need to be able to tell from the data received when the end of data is.

        Comment

        Working...