Xcode 不接受用户输入!

标签 xcode user-input

我的 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;
    }

}

最佳答案

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

关于Xcode 不接受用户输入!,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6164444/

相关文章:

ios - 从 UITableViewController 中的按钮创建操作

xcode - Swift + 解析注销错误

ios - 在 OSX x86-64 上交叉编译 ARM

objective-c - 无法从 Objective-C 调用 Swift 函数

iphone - 使用 C++ 在 iOS 应用程序中找不到的文件夹中的文件

java - 如何修改我的程序以便用户不需要指定输入长度?

python - 如何根据用户输入更新和保存Python脚本(仅变量,无逻辑)?

c++ - atoi() 一直返回 0

javascript - 在运行时更新使用 Three.js 创建的 3D 圆柱体的高度/半径

java - 再次运行程序时如何让扫描仪暂停以进行输入?