diff options
| author | dawidg81 <dawidgorski.m@gmail.com> | 2026-01-26 17:15:33 +0100 |
|---|---|---|
| committer | dawidg81 <dawidgorski.m@gmail.com> | 2026-01-26 17:15:33 +0100 |
| commit | b492bfb0d4cafe69edf69f196911f1b0e64c43df (patch) | |
| tree | 3efa371f146aa98eb4c712137ee07a8199520816 /src/utils/catchInputInt.cpp | |
| parent | 445e27aa9479dbb269aaaf349ed830bcd88905ad (diff) | |
added utilities; recovered custom difficulty editing
Diffstat (limited to 'src/utils/catchInputInt.cpp')
| -rw-r--r-- | src/utils/catchInputInt.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/utils/catchInputInt.cpp b/src/utils/catchInputInt.cpp new file mode 100644 index 0000000..0dc8fc9 --- /dev/null +++ b/src/utils/catchInputInt.cpp @@ -0,0 +1,15 @@ +#include "Utils.hpp" + +#include <cstdio> +#include <iostream> + +int Utils::catchInputInt(int input){ + std::cin >> input; + + if (std::cin.fail()) { + std::cout << "error: Input failed" << std::endl; + return 1; + } + + return 0; +}
\ No newline at end of file |
