Need help with reading into array

i have a project that requires me to read all records from a disk file.
(the record structure: name (20 bytes), grade (integer)).
i have to sort the test scores and calculate the average and write the sorted records to a new file.

the records original file kinda looks like this :
A. smith 89
T philip 95
S. long 76

any help would be greatly appreciated
Last edited on
i have figured out most of it , just having some problems with my sorting.

here is what i have.

void quickSort(vector<Student>& arr, size_t left, size_t right) {
size_t i = left, j = right;
Student tmp;
int pivot = arr[(left + right) / 2].grade;

/* partition */
while (i <= j) {
while (arr[i].grade < pivot)
i++;
while (arr[j].grade > pivot)
j--;
if (i <= j) {
tmp = arr[i];
arr[i] = arr[j];
arr[j] = tmp;
i++;
j--;
}
};
}
Topic archived. No new replies allowed.