M
moleskyca1
In C++ FAQ (15.5), I see this code:
int i = 0;
while (std::cin >> x) { // RIGHT! (reliable)
++i;
// Work with x ...
}
but I don't know how can while loop end? ostream &operator >>(...)
return ostream &. how can that ever end the while loop? Is it because
there is hidden operator to cast to int? I cannot figure out, please
help?
int i = 0;
while (std::cin >> x) { // RIGHT! (reliable)
++i;
// Work with x ...
}
but I don't know how can while loop end? ostream &operator >>(...)
return ostream &. how can that ever end the while loop? Is it because
there is hidden operator to cast to int? I cannot figure out, please
help?