【发布时间】:2014-05-27 00:31:06
【问题描述】:
我在将文件传递给构造函数时遇到问题
#include "WordList.h"
#include<iostream>
#include<fstream>
using namespace std;
WordList::WordList(ifstream& infile){}
-----
int main()
{
WordList w1("input.txt");
}
这里显示错误:
No instance of constructor matches the argument list, the argument types are (const char[10])
那么如何通过构造函数传递文件。
【问题讨论】:
标签: c++ file input constructor ifstream