bool openFiles (ifstream &fhInput);
void sortArray(int array[], int size);
void readFile(ifstream & fhInput, int arraynumbers[], int &arraySize);
const int SIZE = 12;
int sFirstName;
int sLastName;
int iaNames;
int main ()
{
ifstream fhIn;
bool bGoodOpen;
int i;
bGoodOpen = openFiles(fhIn);
if (bGoodOpen == false)
{
cout << "ERROR, file did not open properly, exiting... \n\n";
system ("pause");
return -1;
}
cout << readFile;
system ("pause");
return 0;
}
bool openFiles (ifstream &fhInput)
{
string sFileName;
cout << "File Name: ";
cin >> sFileName;
fhInput.open(sFileName.c_str()); // file input
if(!fhInput)
{
cout << "\nERROR, data file did not open sucessfully. \n";
system ("pause");
fhInput.clear ();
return false;
}
return true;
}
void readFile(ifstream & fhInput, int arraynumbers[], int &arraySize)
{
fhInput >> sFirstName;
while (!fhInput.eof())
{
fhInput >> sLastName;
for (int i = 0; i < 12; i++)
{
//make a new array to store lowest values
//make a new array to store highest values
//
fhInput >> arraynumbers [i];
}
//high (array)
//low (array)
fhInput >> sFirstName;
}
}
void sortArray(int array[], int size)
{
bool swap;
int temp;
do
{
swap = false;
for (int count = 0; count < (size - 1); count++)
{
if (array[count] > array[count + 1])
{
temp = array[count];
array[count] = array[count + 1];
array[count + 1] = temp;
swap = true;
}
}
} while (swap);
}
I need help making the arrays inside the function to output the highest and lowest values any help would be awesome thanks