0

I have to end a loop receiving strings once the last string has been taken. The input is from a file by redirected to stdin. I have to do this automatically and not by input of any keys in run-time. If any external input is the only solution then what should be the corresponding code in c++?

Aseem Dua
  • 143
  • 2
  • 12

1 Answers1

0
while (! stream.eof()) {
    // read from stream
}
Brennan Vincent
  • 10,736
  • 9
  • 32
  • 54