title: Using argv[1] as a filename problems
body: <p>I'm trying to read the file named by <code>argv[1]</code>, but I have no idea on how I go about doing this. It feels like it's something simple, the error message I'm getting when compiling is, </p>
  
  <pre><code>main.cpp: In function ‘void* ReadFile(char**, int&amp;)’:
  main.cpp:43:22: error: request for member ‘c_str’ in ‘*(argv + 8u)’, which is of non-class type ‘char*’
  make: *** [main.o] Error 1
  </code></pre>
  
  <p>This is my code:</p>
  
  <pre><code>#include "movies.h"
  #include &lt;iostream&gt;
  #include &lt;fstream&gt;
  #include &lt;cstring&gt;
  using namespace std;
  
  void *ReadFile(char*[], int&amp;);
  int size;
  int main(int argc, char *argv[])
  {   
      char * title[100];
  
      cout &lt;&lt; argv[1] &lt;&lt; endl;
      //strcpy(argv[1],title[100]);
      //cout &lt;&lt; title &lt;&lt; endl;
      ReadFile(argv , size);
  
      return 0;
  }
  
  void *ReadFile(char * argv[] , int&amp; size)
  {
      char data;
      //char title[50];
      //strcpy(title,argv[1]);
      //cout &lt;&lt; title &lt;&lt; endl;
      ifstream fin;
      fin.open(argv[1].c_str()); //filename
  
      if (fin.good())
      {
          fin &gt;&gt; data;       
          cout &lt;&lt; data &lt;&lt; " ";                      
          while (!fin.eof( ))      
          {
              fin &gt;&gt; data; 
              cout &lt;&lt; data &lt;&lt; " ";               
          }
      }  
  }
  </code></pre>