summaryrefslogtreecommitdiff
path: root/src/Utils/catchInputInt.cpp
blob: dd804b5e5095d5f163a67f5f5bb0a0fdc1af8f64 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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;
}