you're going about it wrong but you probably knew that already.
Here's what to do (I leave it to you to translate that into C++):
declare variable for smallest value
declare variable for largest value
set both to first value in the file
while there's more data
read new value
if smaller than smallest set as smallest
else when larger than largest set as largest
wend
close file
jwenting
duckman
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337