summaryrefslogtreecommitdiff
path: root/src/Utils/catchInputInt.cpp
blob: da99833339809bc92b8387656ecb8ef1ac7a729a (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;
}