I'm writing a program that accepts a file and inputs each line from a txt file into a vector. Is it correct to use:
The class is not what I'm using, it's just to complement the function. What I need help with is the function filereader(string filename).Code:class filereader { public: filereader(string filename); private: } filereader::filereader(string filename) { vector<string> v; ifstream File(filename.c_str()); cin.getline(filename.c_str()); v.push_back(filename); while(cin.good()) { cin.getline(filename.c_str()); v.push_back(filename); } }
I'm sort of confused. I would appreciate any help!



LinkBack URL
About LinkBacks



