我想编写一个程序,它允许用户写一些随机的东西,但我得到了一个 错误,说文件处理C++错误
no matching call to,我无法弄清楚。请帮帮我。 当你试图回答这个问题时,尝试更具体的noob。
这里是我的代码
#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 :) :) and more” –
检查[文档](http://en.cppreference.com/w/cpp/io/basic_istream/get) - 使用'std :: string'的'istream :: get'没有重载。 – jrok