I'm not sure why I am getting this error code. I would like help to fix this problem. It runs just fine on my professor's computer but I am not sure why it won't on mine. It should store the items in an array and print the array out in sorted order but it returns that error code. // // main.cpp
// Test
//
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main() {
int SIZE;
cout << "Enter Array Size: ";
cin >> SIZE;
//Insert tile into an arrav
string filename;
// Name of the file
cout<<"Enter filename:";
cin>>filename;
string line;
// To read each line from code
int i=0;
//Variable to keen count of each line
string * arr = new string[SIZE];
// arrav to store each line
ifstream mFile (filename);
if (mFile.is_open() ){
while(!mFile.eof()){
getline (mFile, line);
arr[i]=line;
i++;
}
mFile.close();
}
else
cout<<"Couldn't open the file\n";
//sort
string temp;
for (int i=0; i < SIZE; ++i){
for (int j=i+1; j < SIZE; ++j){
if (arr[i] > arr[j]){
temp = arr[i];
arr[i] = arr[j];
arr[j] = temp;
}
}
}
for (int i = 0; i < SIZE; i++)
cout << arr[i] << endl;
return 0;
}