📜  检测用户输入 cpp 的结束 - C++ 代码示例

📅  最后修改于: 2022-03-11 14:44:53.704000             🧑  作者: Mango

代码示例1
while (cin.peek() != EOF) {
  // To do your stuff...
  // NOTE: peek() will set failbit when peeking end of stream and return EOF(-1).
}