I'm having trouble understanding what I'm supposed to do and how to do it, please help
Code:
#include<iostream>
#include<fstream>
#include<string>
using namespace std;
/* TODO: Write the declaration (prototype) for void function GetLeast that
takes an ifstream parameter called infile as an input parameter
that is changed, and that has an int parameter called lowest
that returns a value.
Document the data flow for the parameters with appropriate comments.
*/
//------------------------------------------------------------------------------
int main()
{
int smallestValue = INT_MAX; // Initialize smallest to maximum range
ifstream dataFile; // File input stream
const string filename = "data.txt"; // Input file name
cout << "Opening file...";
dataFile.open(filename.c_str()); // Open file
if(dataFile) // File opened OK?
{
cout << "file opened." << endl
<< "Begin searching for lowest value...";
/* TODO: Call function GetLeast, passing the ifstream variable
and int variable as arguments.
*/
cout << "done.\n" << endl; // Print result
cout << "The lowest value found was "
<< smallestValue << endl;
}
else // Problem opening file
{
cout << "could not find or open file: " << filename
<< endl;
}
dataFile.close();
cout << "\nEnd Program.\n"
<< endl;
return 0;
}