diff --git a/du5/program.c b/du5/program.c index 4abe9df..9e0a5ab 100644 --- a/du5/program.c +++ b/du5/program.c @@ -13,7 +13,7 @@ int main() char question[SIZE]; char question2[SIZE]; char answer = '0'; //'0' = ako keby 'NULL'/ absencia hodnoty - int readLineNumber = 1; + bool isFirstQuestionRead = false; bool isFirstOptionLoaded = false; bool err = false; @@ -43,16 +43,16 @@ int main() answer = line[0]; break; } - else if (readLineNumber == 1) + else if (!isFirstQuestionRead) { sscanf(line, "%127[^\n]]", question); + isFirstQuestionRead = true; // strcat(question, "?"); } else { sscanf(line, "%127[^\n]]", question2); } - readLineNumber += 1; } if (answer == '0') { err = true; }