title: How to copy words from .txt file into an array. Then print each word on a separate line
body: <p>The goal is to read a set of strings from a file called "words.txt" and save each word into the array strings. However I am have trouble saving and printing the words to the console. I think the problem is within my GetStrings function but I can't figure out why. Nothing prints out to the console when the PrintStrings function is called. Which makes me think that either nothing is being saved into the array or the print function is not correct.</p>
  
  <pre><code>int main ()
  {
      int count = 0;
      string strings [MAXSTRINGS];
      GetStrings(strings);
      // cout &lt;&lt; strings[1];
      PrintStrings(strings, count);
      return 0;
  }
  
  int GetStrings (string S [])
  {
      ifstream input ("words.txt");
      int count = 0;
      while (input &gt;&gt; S[count])
      {
          count++;
      }
      input.close ();
      return 0;
  }
  
  void PrintStrings (string S [], int C)
  {
      int w = 0;
      while (w &lt; C)
      {
          cout &lt;&lt; S[w] &lt;&lt; endl;
          w++;
      }
  }
  </code></pre>