diff --git a/cv7/program.c b/cv7/program.c index 2034ca8..4c23f5d 100644 --- a/cv7/program.c +++ b/cv7/program.c @@ -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; } +