1. Welcome to the new MacRumors forums. See our announcement and read our FAQ

standard input not working in xcode

Discussion in 'Mac Programming' started by johnmerlino, Mar 28, 2012.

  1. macrumors member

    Hi all,

    Trying to compile a basic c++ program in xcode:

    #include <iostream>
    int main (int argc, const char * argv[])
        std::cout << "Enter your name";
        std::string name;
        std::cin >> name;
        std::cout << "Welcome, " + name;
        return 0;
    I look at console in xcode and it prints "Enter your name", but it should also prompt me to enter a name but it doesn't

    thanks for response

Share This Page