I have to make up a fucntion that passes an array of int and it's size then only prints out numbers above average from one file to another and i think i got it to work mostly but its not outputting any thing any thoughts ?
Here is what I have so far
#include <iostream>
#include <fstream>
using namespace std;
void over_average(int array[7], int size, ofstream& outstream);
int main() {
ifstream inStream; ofstream outStream;
int array[7];
inStream.open("TextFile1.txt");
if (inStream.fail())
{
cout << "ERROR: Failed to open input \n"; exit(-1);
}
outStream.open("Output.txt");
if (outStream.fail()){ cout << "ERROR: Failed to open input \n"; exit(-2);
}
over_average(array, 7, outStream);
inStream.close();
outStream.close();
return 0;
}
}