Answers for "detect end of user input cpp"

C++
0

detect end of user input cpp

while (cin.peek() != EOF) {
  // To do your stuff...
  // NOTE: peek() will set failbit when peeking end of stream and return EOF(-1).
}
Posted by: Guest on July-23-2021

Browse Popular Code Answers by Language