title: User input filename
body: <pre><code>#include &lt;iostream&gt;
  #include &lt;fstream&gt;
  #include &lt;cassert&gt;
  #include &lt;cstring&gt;
  
  using namespace std;
  
  const int WL = 20;
  const int WR = 1000;
  
  void READ (ifstream &amp;, char[], char[][WL], int &amp;);
  void PRINT (char [][WL],  int, int,  int );
  
  int main()
  {
      ifstream file;
      string fileName;
      cout &lt;&lt; "enter file name";
      getline(cin, fileName);
      char name[] = fileName;
      char Word[WR][WL];
      int row = 0;
      int WordMax;
      int WordMin;
  
      file.open(name);
      assert(! file.fail() );
      READ (file, name, Word, row);
      file.close();
      cout &lt;&lt; "file successfully opened" &lt;&lt; endl;
  
      cout &lt;&lt; "word length: \n";
      cout &lt;&lt; "min: ";
      cin &gt;&gt; WordMin;
      cout &lt;&lt; "max: ";
      cin &gt;&gt; WordMax;
  
      PRINT(Word, row, WordMin, WordMax);
  
      system("pause");
      return 0;
  }
  </code></pre>
  
  <p>As I understand, the problem is that I can't use <code>fileName</code> in <code>char name[]</code>, because it is <code>string</code>, but <code>char name[]</code> will be used in the code later... what can I change to fix this?</p>