Lets write a function to return the minimum and the maximum value.
Because the function returns two values we cannot use the standard return mechanism to do both, therefore we will use reference parameters. Input and output file stream objects are always sent as reference parameters. We address that question shortly. We now consider the implementation of the function we have suggested. What is needed is to read each integer in the file and check to see if he smallest or the largest found so far, if it is save it in a special location to compare with the next integer read.