Why isn't cin >> string working with Visual C++ 2010? [closed]

做~自己de王妃 提交于 2019-12-17 18:33:25

问题


#include <iostream>

using namespace std;

int main() {
    string s;
    cin >> s;
    cout << "Hello World!";
}

This isn't working. Why?


回答1:


Because you forgot to #include <string>




回答2:


You should #include <string>



来源:https://stackoverflow.com/questions/5343035/why-isnt-cin-string-working-with-visual-c-2010

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!