View Single Post
Old 10-29-2004, 07:58 PM   #12 (permalink)
Valmont
[code][/code] enforcer
 
Valmont's Avatar
 
Join Date: Mar 2003
Location: Netherlands
Posts: 1,544
Valmont is on a distinguished road
Quote:
Originally Posted by gamehead200
Valmont, I understand what you mean when you say not to use the while( !in_file.eof() ) loop, however, why do you use the while( in_file >> word ) instead? Doesn't this just read the word from the file in a loop?
No, because at each read, an internal pointer is moved up with one. So the next time the next item is read if exists.
Eacht time a valid item is read, a value that can be interpreted as "true" returns to the while statement.
__________________
Valmont is offline   Reply With Quote