Is there any way to end writing to the console, terminate the writing and continue program, if you code the input as
std::istream_iterator<std::string> ii(std::cin);
std::istream_iterator<std::string> eos;
std::for_each(ii,eos,record);
I wonder if you can put something in the console that will terminate the input process if it is coded this way.
You can send an EOF to the standard input stream from the terminal by pressing CTRL-Z on Windows or CTRL-D on Linux.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With