【发布时间】:2015-03-01 13:18:02
【问题描述】:
getline() 有问题。
我尝试了许多示例并阅读了其他解决方案,但这并没有解决我的问题。我还有信息'getline: identifier not found'。
我包括
<stdio.h> <tchar.h> <iostream> <conio.h> <stdlib.h> <fstream> 还是什么都没有。
#include "stdafx.h"
using namespace std;
int main(int argc, _TCHAR* argv[])
{
string line;
getline(cin, line);
cout << "You entered: " << line << endl;
}
我现在需要做什么?
我使用 Windows 7 64 位和 Visual Studio 2013。
【问题讨论】:
-
<string>将是您在其中找到std::getline的文件 -
胡乱猜测并不是编程的好方法。是什么让您无法简单地在文档中查找此内容?
标签: c++ visual-studio-2013 getline