title: Input from text file into char *array[9]
body: <p><img src="https://i.stack.imgur.com/2Q7vd.png" alt="The error message"></p>
  
  <p>I have a file with 9 words and i have to store each word into the char array of 9 pointers but i keep getting an error message. I cannot use vectors!</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;fstream&gt;
  
  
  using namespace std;
  
  
  int main()
  {
     char *words[9];
     ifstream inStream;
     inStream.open("sentence.txt");
     if (inStream.fail())
     {
         cout &lt;&lt; "Input file opening failed.\n";
         exit(1);
     }
  
     for ( int i = 0; i &lt; 10; i++)
     {
         inStream &gt;&gt; words[i];
     }
  
         inStream.close();
  
     return 0;
  }
  </code></pre>