summaryrefslogtreecommitdiff
path: root/src/Utils.cpp
blob: 37ebefe7ddfca9d3eba5a613d837558826baad93 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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;
}