diff options
| author | dawidg81 <dawidgorski.m@gmail.com> | 2026-01-28 20:01:46 +0100 |
|---|---|---|
| committer | dawidg81 <dawidgorski.m@gmail.com> | 2026-01-28 20:01:46 +0100 |
| commit | b0edb4219ea4df381d0235aa34b74799334aa0b2 (patch) | |
| tree | 9607358416596125857b25394a267eb562e6fcc5 /src/Utils.cpp | |
| parent | 6ce59baf37e6f009fd6854b701f0e3795fa38dc8 (diff) | |
finished merging code and simplifying file structure
Diffstat (limited to 'src/Utils.cpp')
| -rw-r--r-- | src/Utils.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/Utils.cpp b/src/Utils.cpp new file mode 100644 index 0000000..37ebefe --- /dev/null +++ b/src/Utils.cpp @@ -0,0 +1,22 @@ +#include "Utils.hpp" + +#include <iostream> +#include <ostream> + +int Utils::catchInputInt(int* input){ + std::cin >> input; + + if (std::cin.fail()) { + std::cout << "error: Input failed" << std::endl; + return 1; + } + + return 0; +} + +int Utils::catchReturn(int renum){ + if (renum != 0) { + std::cout << "Received error signal, sending further" << std::endl; + } + return 0; +} |
