Part of the code from the program I'm having trouble with. The deletion of array element for this doesn't work properly. Can anyone tell me why? I can't spot any mistakes though zzz,
cin.ignore();
delStudentCounter = 0;
cout << "Please enter ID to delete student: ";
cin.getline(delStudent, 50);
for (int n = 0; n < MAX_STUDENTS; n++)
{
if (strcmp(delStudent, students[n].ID) == 0)
{
delStudentCounter = 1;
delStudentNumber = n;
}
}
if (delStudentCounter = 1)
{
for (int o = delStudentNumber; o < MAX_STUDENTS-1; o++)
{
students[o] = students[o+1];
}
i--;
}
else
cout << "Student does not exist!";