【发布时间】:2013-06-25 11:48:00
【问题描述】:
我想编写一个程序,允许用户编写一些随机的东西,但我得到了一个 说错了
没有对的匹配调用,我无法弄清楚。请帮我。 当您尝试回答这个问题时,请尝试更加具体。
这是我的代码
#include<iostream>
#include<fstream>
#include<string>
using namespace std;
int main()
{
string story;
ofstream theFile;
theFile.open("Random.txt");
while(cin.get(story,5000)!=EOF)
{
theFile<< story;
}
return 0;
}
【问题讨论】:
-
您遇到了什么错误?
-
没有匹配的调用“std::basic_istream
::get(std::) 等等” -
检查the documentation - 没有
istream::get的过载导致std::string。