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
Reputation Points: 1658
Solved Threads: 331
duckman
Offline 7,719 posts
since Nov 2004