title: Exception thrown at 0x50E6F1C0 (ucrtbased.dll) in CandidateVotes.exe: 0xC0000005: Access violation reading location 0x00000000
body: <p>I'm getting this notification when I try to run my program. </p>
  
  <p>Exception thrown at 0x50E6F1C0 (ucrtbased.dll) in CandidateVotes.exe: 0xC0000005: Access violation reading location 0x00000000.</p>
  
  <p>Here's my code:</p>
  
  <p>Write a program that allows the user to enter the last names of five candidates 
  in a local election and the number of votes received by each candidate.
  The program should then output each candidate's name, the number of votes received, 
  and the percentage of the total votes received by the candidate.
  Your program should also output the winner of the election.</p>
  
  <pre><code>void main()
  
  {
      string name[5] = { 0 };
      int votes[5] = { 0 };
      int total = 0;
  
      for (int i = 0; i &lt; 5; i++)
      {
          cout &lt;&lt; "What is the name of Candidate number " &lt;&lt; i + 1 &lt;&lt; "?" &lt;&lt; endl;
          cin &gt;&gt; name[i];
  
          cout &lt;&lt; "How many votes did " &lt;&lt; name[i] &lt;&lt; " receive?" &lt;&lt; endl;
          cin &gt;&gt; votes[i];
  
          total += votes[i];
  
          cout &lt;&lt; total &lt;&lt; endl;
      }
  
      system("pause");
  
  }
  </code></pre>