谢谢
。我刚刚调的是这样的。成功了。
class txtRead{
private:
fstream newsFile;
int rows;
int cols;
char news;
public:
void printTxt();
void countNum();
txtRead();
};
txtRead::txtRead(){
newsFile.open("I:\\NewBrowserText.txt");
if(!newsFile){
cout<<"you get wrong file's address!"<<endl;
}
}