From 5fb9f60c377cbc60865b63212c9cdac55bff70d5 Mon Sep 17 00:00:00 2001 From: Yevhen Kozirovskyi Date: Thu, 14 Nov 2024 20:33:26 +0000 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20cv7/program.c?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cv7/program.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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; } +