求助:有关ifstream
我有段代码:
class myClass{
private:
ifstream ifile;
public:
myClass(ifstream & file){ifile = file};//这里有错误
};
int main(int argc, char **argv)
{
string file = "input.txt";
ifstream ifile(file.c_str());
myClass myclass(ifile);
return 0;
}
用dev-c++编译
编译错误信息是:
'std::ios_base& std::ios_base::operator=(const std::ios_base&)' is private
请问有遇到过这个问题吗?怎么解决的。
谢谢