2011-05-28 167 views
4

我的Xcode会编译,但不会让我输入什么Xcode不接受用户输入!

#include <iostream> 
using namespace std; 

bool truthStatement; 
int main (int argc, const char * argv[]) 
{ 
    string name; 
    cout << "What is your name?" << endl; 
    cin >> name; 
    if (name == "Matt"){ 
     cout << "You're cool" << endl; 

    } else { 
     cout << "You suck" << endl; 
    } 

} 
+0

这仍然是你的问题吗?刚刚在XCode中尝试过一个测试项目。似乎工作正常。 – 2011-09-02 14:49:51

+0

您的问题是否已解决? – 2011-12-03 02:17:40

回答

0

我以前也有这个问题。确保您使用的是Return键而不是键盘上的Enter键。