Pergunta

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!

Foi útil?

Solução

need something more like this:

int prompt(string promptString) {
    int input = 0;
    cout << promptString;
    cin >> input;
    return input;  
}
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top