Isthe same asCode:while(cin)?Code:while(!cin.eof())
Isthe same asCode:while(cin)?Code:while(!cin.eof())
no
cin can be in a fail state due to error even when eof not riched yet
All problems in computer science can be solved by another level of indirection,
except for the problem of too many layers of indirection.
– David J. Wheeler