standard input not working in xcode

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

  1. macrumors member

    Joined:
    Oct 22, 2011
    #1
    Hi all,

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

    Code:
    #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