Initialization
This commit is contained in:
parent
9fdb2f3d35
commit
286056678a
@ -28,7 +28,6 @@ int main() {
|
||||
|
||||
int i, found = 0;
|
||||
|
||||
// Remove the newline character from the temp_name array
|
||||
temp_name[strcspn(temp_name, "\n")] = '\0';
|
||||
|
||||
for (i = 0; i < num_accepted; i++) {
|
||||
@ -38,15 +37,15 @@ int main() {
|
||||
}
|
||||
}
|
||||
|
||||
if (!found) {
|
||||
if (!found && num_accepted < MAX_STUDENTS) {
|
||||
strcpy(names[num_accepted], temp_name);
|
||||
num_accepted++;
|
||||
}
|
||||
num_students++;
|
||||
|
||||
// Check if we have reached the maximum number of accepted students
|
||||
|
||||
if (num_accepted == max_students) {
|
||||
break; // Exit the loop
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user