十年前,我在VB.NET中编写了一些应用程序,现在正在尝试自学C ++。
[我试图找出如何正确处理用户输入的内容,偶然发现以下链接,该链接讨论了该主题以及其他数据类型的GetInteger函数的创建等。
[GetInteger() @templatetypedef
我遇到错误; “标识符'GetLine'未定义。也许这是一个重载函数,它返回在另一堂课中定义的字符串流?任何方向将不胜感激。
#include <iostream>
#include <sstream>
#include <string>
using namespace std;
int GetInteger() {
while (true) {
stringstream converter;
converter << GetLine();
}
}
为了完成注释中的内容,您的代码还必须提供GetLine: