From 4c11df316052bc5f82b2ff6eef12c05a24ca7bf2 Mon Sep 17 00:00:00 2001 From: Love Billenius Date: Wed, 4 Sep 2024 22:10:10 +0200 Subject: [PATCH] Fix input --- src/life.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/life.cpp b/src/life.cpp index 6e1d717..8386583 100755 --- a/src/life.cpp +++ b/src/life.cpp @@ -25,14 +25,15 @@ void printWelcome() { } std::string input(const char *message) { - if (message != nullptr) { - std::cout << message << FORMAT_UNDERSCORE; - std::flush(std::cout); - } + if (message != nullptr) + std::cout << message; + + std::cout << FORMAT_UNDERSCORE; + std::flush(std::cout); + std::string ret; std::getline(std::cin, ret); - if (message != nullptr) - std::cout << END_FORMATTING; + std::cout << END_FORMATTING; return ret; }