title: Process returned -1073741819 (0xC0000005) in code::blocks c++
body: <p>I have a program that uses getline to populate an array of strings. When I run this program, it outputs the correct values from the getline(cin) and then the program crashes, issuing the error messege
  "Process returned -1073741819 (0xC0000005)" I understand that this code has to deal with accessing memory locations. I have tried using pointers, but everything that I have tried has caused the program to crash in the same manner. 
  Can you please provide advice on what I can do to fix this issue? </p>
  
  <p>I am using Code::Blocks for this program on windows 10</p>
  
  <p>edit: I am putting the strings in an array to be tested for the number of similar words</p>
  
  <pre><code>    int wordCount = 0;
      cout &lt;&lt; "Enter the number of words in your email: ";
      cin &gt;&gt; wordCount; //size of array determined by wordCount, which is retrieved from the user
      string testEmail[wordCount] = { }; // declaring and initializing the array
      cout &lt;&lt; "Enter the email you wish to test: ";
      getline(cin &gt;&gt; std::ws, testEmail[wordCount]); // this will populate the array from user input
      cout &lt;&lt; "The email that will be tested is: ";
      for(int i=0; i&lt;wordCount; i++) // for loop used for testing
          cout &lt;&lt; testEmail[i] &lt;&lt; " ";
  </code></pre>