Initialization
This commit is contained in:
parent
ed42221d74
commit
52ce942162
@ -27,11 +27,7 @@ int main() {
|
||||
}
|
||||
|
||||
// Načítanie prihlášok
|
||||
while (num_applications < max_students && fgets(buffer, sizeof(buffer), stdin) != NULL && buffer[0] != '\n') {
|
||||
size_t len = strlen(buffer);
|
||||
if (buffer[len - 1] == '\n') {
|
||||
buffer[len - 1] = '\0'; // odstránenie koncového znaku nového riadku
|
||||
}
|
||||
while (num_applications < max_students && scanf("%s", buffer) == 1) {
|
||||
applications[num_applications] = strdup(buffer);
|
||||
if (applications[num_applications] == NULL) {
|
||||
puts("Chyba alokacie pamate");
|
||||
|
Loading…
Reference in New Issue
Block a user