Initialization
This commit is contained in:
parent
4c61369996
commit
d97efb1f8e
@ -29,9 +29,18 @@ int main() {
|
||||
if (len > 0 && buffer[len - 1] == '\n') { // Remove newline character if present
|
||||
buffer[len - 1] = '\0';
|
||||
}
|
||||
int found = 0;
|
||||
for (j = 0; j < i; j++) {
|
||||
if (strcmp(applications[j], buffer) == 0) {
|
||||
found = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
applications[i] = strdup(buffer);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
if (i == 0) {
|
||||
printf("Ziadne prihlasky\n");
|
||||
@ -43,7 +52,7 @@ int main() {
|
||||
|
||||
printf("Prijati studenti:");
|
||||
for (j = 0; j < i; j++) {
|
||||
printf("%s", applications[j]);
|
||||
printf("%s\n", applications[j]);
|
||||
}
|
||||
|
||||
if (count < i) {
|
||||
|
Loading…
Reference in New Issue
Block a user