title: Trying to read a file into a char array
body: <p>I am trying to read all the characters in a file into an array.  Assuming all variables are declared, why are all the characters not being read into my array.  When I output some of the characters in the "storeCharacters[]" array, garbage is being returned.  Please help.</p>
  
  <p>This is my function:  </p>
  
  <pre><code>void countChars(ifstream&amp; input, char storeCharacters[])
  {
  int i = 0;
      while( !input.eof() )
      {
          input.get(storeCharacters[i]);
          i++;
      }
  }
  </code></pre>