Is EOF always negative?

后端 未结 6 1940
被撕碎了的回忆
被撕碎了的回忆 2020-12-11 17:05

Is EOF always negative?

I\'m thinking of writing a function that reads the next word in the input and returns the line number the word was found in or

6条回答
  •  误落风尘
    2020-12-11 17:28

    EOF is a condition, rather than a value. The exact value of this sentinel is implementation defined. In a lot of cases, it is a negative number.

提交回复
热议问题