Will someone please take a look at this and give me an idea of why my sort function isn't working? My assignment is already past due but at this point I really want to know how to do it because this this has been the death of me all week. my total hours are calculated in each row during the first function and fed back to the array in the main and held in the 8th element aka arr[][7] for each row. taking that and passing it into a bubble sort function was the next step. i thought I had it but every time it runs, i get back errors. what am i missing? thank you
void getData(int arr[][8], string name[50], int length) {
ifstream fin;
fin.open("empdata2.txt");
int i;
fin >> i;
if (fin.fail()) {
cout << " Your file was unable to open.\n\n";
exit(1);
}
arr[50][8];
name[50];
int total = 0;
for (int row = 0; row < i; ++row) {
fin >> name[row];
cout << name[row] << " ";
total = 0;
for (int day = 0; day < 7; day++) {
fin >> arr[row][day];
total += arr[row][day];
cout << setw(3) << arr[row][day];
}
cout << setw(3) << total << endl;
cout << endl;
}
fin.close();
}void bubbleSort(int arr[][8], string name[50], int length)
{
int total = arr[0][7];
Update: I have updated what i have added to the code and where i am at in it. please give any feedback would be great. my assignment was due this morning and my teacher does not accept late work so at this point it is more for my satisfaction to know what the program is that defeated me.