Getting input in system() function (Mac)

Posted by Alex on Stack Overflow See other posts from Stack Overflow or by Alex
Published on 2010-06-08T21:25:28Z Indexed on 2010/06/08 21:32 UTC
Read the original article Hit count: 146

Filed under:
|
|
|
#include <iostream>
using namespace std;

int main() {

    short int enterVal;
    cout << "enter a number to say: " << endl;
    cin >> enterVal;
    system("say "%d"") << enterVal;

    return 0;
}

Is what I am currently trying. I want the user to enter a number and the system() function says it basically. The code above has an error which says " 'd' was not declared in this scope ". Thanks in advance.

© Stack Overflow or respective owner

Related posts about c++

Related posts about mac