for (int i = 0; i < n - 1; i++) {
for (int j = 0; j < n - i - 1; j++) {
if (sortDoctorArray[j].doctorCode > sortDoctorArray[j + 1].doctorCode) {
Doctor* tempDoctor = new Doctor[1];
tempDoctor[0] = sortDoctorArray[j];
sortDoctorArray[j] = sortDoctorArray[j + 1];
sortDoctorArray[j + 1] = tempDoctor[0];
}
}
}