oop

How do I create a class (named FileAnalyzer) which accepts the file name of a file to analyze via its constructor? Please help me I'm stuck.
Your class could look like this:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
class FileAnalyzer
{
private:
    std::fstream file;
public:
    FileAnalyzer(std::string fileName)
    {
        file.open(fileName.c_str());
        process();
    }
    void process()
    {
        //Do stuff
    }
};
Topic archived. No new replies allowed.