title: Initializing private istream data member in C++
body: <p>I'm currently trying to initialise a private istream variable in class.
  The class definition looks like:</p>
  
  <pre><code>    #define PARSER_H
  
  class parser {
    public:
      parser();
      parser(string predict_table_file_name);
   private:
      int getMaxRHS(string predict_table_file_name);
      int getMaxPairs(string predict_table_file_name);
      int getMaxPairsY(string predict_table_file_name);
      int getMaxRHSY(string predict_table_file_name);
      int getMaxSymbols(string predict_table_file_name);
      int getGoalSymbol(string predict_table_file_name);
      int getNumberOfTerminalSymbols(string predict_table_file_name);
      string getSymbol(int symbolID);
      string getToken();
      string openFile(string sourceFile);
      bool isTerminalSymbol(string token, string symbolArray[], int terminalSymbols);
      istream scanFile;
  };
  
  #endif
  </code></pre>
  
  <p>The variable in question is "istream scanFile".  The code I'm using to try and initialize it looks like this.</p>
  
  <pre><code>string parser::openFile(string sourceFile) {
    filebuf fb;
    fb.open(sourceFile.c_str(), ios::in);
    parser::scanFile(&amp;fb);
  }
  </code></pre>
  
  <p>The line "parser::scanFile(&amp;fb);" is giving me the trouble.  Apparently the compiler thinks I'm trying to call function, which I guess I am, but I just want to call the constructor on parser::scanFile.</p>
  
  <p>I'm new-ish to C++, so any help would be greatly appreciated.</p>