This commit is contained in:
Andrii Hutsuliak 2025-03-08 18:10:35 +01:00
parent 19d91f2d97
commit 88142f570c

View File

@ -81,7 +81,10 @@ int main() {
students[count++] = createStudent(name, count_of_vote); students[count++] = createStudent(name, count_of_vote);
} }
} }
if(count == 0) {
printf("Nepodarilo nacitat nic\n");
return 0;
}
// Zoradenie študentov podľa počtu hlasov a mena // Zoradenie študentov podľa počtu hlasov a mena
qsort(students, count, sizeof(Student), compare_students); qsort(students, count, sizeof(Student), compare_students);