【发布时间】:2013-07-24 09:22:33
【问题描述】:
我需要这样的类中的向量成员:
class A
{
private:
vector<ifstream> _files;
public:
bool addFile(const string& filePath);
};
bool A::addFile(const string& filePath)
{
ifstream ifile(filePath.c_str());
_files.push_back(ifile);//but errors;
}
我怎样才能成功编译完成这门课;
现在我的解决方案是使用矢量。那样可以么?还是一些潜在的危险?
【问题讨论】: