Обновить cv7/program.c
This commit is contained in:
parent
7a9064d314
commit
5fb9f60c37
@ -71,12 +71,12 @@ void znalostny_system(Node *uzol) {
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
if (argc < 2) {
|
||||
printf("Chyba: zadajte cestu k súboru ako argument.\n");
|
||||
return 1;
|
||||
const char *filename = "baza.txt";
|
||||
if (argc > 1) {
|
||||
filename = argv[1];
|
||||
}
|
||||
|
||||
FILE *file = fopen(argv[1], "r");
|
||||
FILE *file = fopen(filename, "r");
|
||||
if (!file) {
|
||||
printf("Chyba pri otváraní súboru.\n");
|
||||
return 1;
|
||||
@ -101,3 +101,4 @@ int main(int argc, char *argv[]) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user