一个ifstream 打开文件的错误
void bayes(){ ifstream infile("ls-train.txt"); ifstream input; if(!infile) { cout << "dict open error "<<endl; } string word; string filename; char *temp = (char *)malloc(sizeof(char) * 10) ; int i = 1; int type; /*这一步 是统计每一分类 ,他每个单词出现的次数*/ while(infile >> filename) { //strcpy(temp,filename.c_str()) ; //type = temp[0] - '0'; [color=#FF0000] input( filename.c_str() ); //这一步报错 : no match for call to ‘(std::ifstream) (const char*)[/color] if( ! input) ; cout << filename << " open error" << endl; input.close(); } infile.close();