In an example given in C++ Primer,
#include <iostream>
using namespace std;
int main() {
int sum = 0, value = 0;
while (std::cin >> value) {
sum += value; // equivalent to sum = sum + value
}
std::cout << "Sum is: " << sum << std::endl;
return 0;
}
How does (std::cin >> value) return true? And what is an "End Of File"? It seems that I must understand that term in order to understand my primary question.
Thanks!
See Question&Answers more detail:os