if (inputFile.is_open())
{
cout <<"Finished loading data" << endl;
int count;
while (inputFile >> count) // Count the numbers in the file
size++;
inputFile.clear();
inputFile.seekg (0, ios::end);
inputFile.seekg (0, ios::beg);
// Allocates new memory
int* temp = newint[size];
// Copies values over to temp
for (int* i = arra; i; i ++)
*temp = *i;
// Frees old memory
delete[] arra;
// Points arra to the resized array
arra = temp;
//Close the file stream
inputFile.close();
}
You read all of the information in from the text file into the variable count, which I'm presuming is purely to count the number of numbers in the file (there is a much easier way to do this), increase the value of size, which is already started at 100 (See here: int isize=100;) And then you resize a new array, copy the values over (which you had none stored as of yet), then finish your function. You never actually write any of your values into your array.
Haha, I wrote that for the OP while I was dead tired, oops. I honestly can't think of how to fix that either since it's 6:33AM again and I have been drinking this time. -.-'