title: Error reading char values from a .txt file into an array C++
body: <p>I have to write a program that reads single char values from a .txt file into an array. When I run the code it displays a bunch of weird symbols.</p>
  
  <p><img src="https://i.stack.imgur.com/LfK4V.png" alt="enter image description here"></p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;fstream&gt;
  using namespace std;
  
  int main()
  {
  const int NUM_ANS = 10;
  char answers[NUM_ANS], student[NUM_ANS];
  
  
  ifstream correctAnswers;
  correctAnswers.open("C:\\Users\\RCLRC115\\Desktop\\student.txt");
  int count = 0;
  while (count &lt; NUM_ANS &amp;&amp; correctAnswers &gt;&gt; answers[count])
      count++;
  
  for (int i = 0; i &lt; NUM_ANS; i++) {
      cout &lt;&lt; answers[i] &lt;&lt; endl;
  }
  
  cin.get();
  return 0;
  }
  </code></pre>