help: | 22 | error: invalid conversion from 'int (*) (const char *)' to 'int' [-fpermissive] | [closed]

-2
int SafeCapture (const char errorChar[50]);

int main(){
    int dimention, dimLimChar;
    char str[50];
    dimention = SafeCapture;

    cout << "-------------------------------------------------\n"
         << "This console application draws some figures like\n"
         << "hourglass, rhomb, bow and a rummer. Both of them\n"
         << "shows filled or void.\n"
         << "-------------------------------------------------\n\n";

    dimLimChar = sprintf(str, "The next request needs a number between %d and %d.", DIMMIN, DIMMAX);

}

#include <limits>

int SafeCapture (const char errorChar[50]){

    int dimention;

    while (true){
        cout << "\nPlease, enter the dimention what you want: ";
        cin >> dimention;

        if (cin.bad()){
            cout << "UNRECOVERABLE SYSTEM FAIL: Console application will close now.\n";
            exit(1);
        }
        if (cin.fail()){
            cout << "ERROR, This is not a number... Please try again.\n";
            cin.clear();
            cin.ignore(numeric_limits<int>::max(),'\n');
            continue;
        }
        break;
    }

    return dimention;
}
    
asked by Jesus Escobedo 28.09.2017 в 07:29
source

1 answer

1
dimention = SafeCapture( str );

Following the minimalist style of the question; -)

    
answered by 28.09.2017 в 07:34