-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
std::cin.eof() #6
Comments
std::cin.eof() is first introduced in chapter 7. The comment above the while loop (starting line 39 of chapter 7) explains how this is used to break out of the loop. Here is the comment:
If you supply the program with a file, then the loop will end when it reaches the end of the file. When you type numbers through the terminal, you have to send the end of file (eof) value yourself. Control-Z in Windows and Control-D in Unix systems will send the eof value to the program, which will end the loop. |
OK thanks. |
Hi,
I wasn't able to exit program in chapter 6, i keep typing numbers in the terminal but where end of file?
if(std::cin.eof()) {
break;
}
when it breaks?
The text was updated successfully, but these errors were encountered: