Discussion Locked

Use of Ctrl-Z in C++

0 helpful
1 reply
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

In C language, I can stop input by keyboard using Ctrl-Z to indicate finish of input.
How can I indicate the same result using the stream of C++, cin ??

1 reply

by marsh lion

I presume when you say Ctrl-Z you are talking about the EOF in Windows. Yes you can use cin but note that you may have to check that each caracter that you input is not the EOF.

This discussion is closed to new replies.