문제

I am trying to issue a prompt to the terminal, which reads an integer, and returns that integer.

int prompt(string promptString) {
    int input = 0;
    cin >> promptString;
    input = promptString;
    return input;  
}

Thank you!

도움이 되었습니까?

해결책

need something more like this:

int prompt(string promptString) {
    int input = 0;
    cout << promptString;
    cin >> input;
    return input;  
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top