Aktualizovat du5/program.c

This commit is contained in:
Tomáš Vlček 2026-04-14 21:12:24 +00:00
parent d83467c485
commit 2d341b1d7a

View File

@ -14,6 +14,7 @@ int main()
bool isFirstOptionLoaded = false; bool isFirstOptionLoaded = false;
char answer = '0'; //'0' = ako keby 'NULL'/ absencia hodnoty char answer = '0'; //'0' = ako keby 'NULL'/ absencia hodnoty
bool err = 0; bool err = 0;
int readingCurrentlyLine = 1;
option1[0] = '\0'; option1[0] = '\0';
option2[0] = '\0'; option2[0] = '\0';
@ -40,11 +41,12 @@ int main()
answer = line[0]; answer = line[0];
break; break;
} }
else else if (readingCurrentlyLine == 4)
{ {
sscanf(line, " %127[^?]", question); sscanf(line, " %127[^\n]", question);
// strcat(question, "?"); // strcat(question, "?");
} }
readingCurrentlyLine += 1;
} }
if (answer == '0') { err = true; } if (answer == '0') { err = true; }