title: Trying to make a program in C++ that will take an array of strings and count the number of vowels that occur
body: <p>My code doesn't have any redlines under it in the IDE but it won't run. I think I am doing something wrong with the comparisons in the if-else statements; I don't think I completely understand the types that are being compared there.</p>
  <p>Could someone please tell me what I am doing wrong?</p>
  <pre><code>#include &lt;iostream&gt;
  
  // Creating some Global Variables that will keep track of the counts of the vowels.
  int a = 0, e = 0, i = 0, o = 0, u = 0;
  
  // This function will count the number of vowels.
  void get_array_stats(std::string arr[], int arr_length) {
  
      // The goal setting these values to zero is so each time this function is used, the vowel count are reset to 0.
      // That is my intention.
      a = 0; e = 0; i = 0; o = 0; u = 0;
      for (int c = 0; c &lt; arr_length; i++) {
          for (int j = 0; arr[c].length(); j++) {
              if (arr[c][j] == 'a') {
                  a++;
              }
              else if (arr[c][j] == 'e') {
                  e++;
              }
              else if (arr[c][j] == 'i') {
                  i++;
              }
              else if (arr[c][j] == 'o') {
                  o++;
              }
              else if (arr[c][j] == 'u') {
                  u++;
              }
          }
      }
  
  }
  
  // This function will display the number of vowels.
  void display_stats() {
      std::cout &lt;&lt; &quot;[ Vowel Statistics ]&quot; &lt;&lt; std::endl;
      std::cout &lt;&lt; &quot;a: &quot; &lt;&lt; a &lt;&lt; std::endl;
      std::cout &lt;&lt; &quot;e: &quot; &lt;&lt; e &lt;&lt; std::endl;
      std::cout &lt;&lt; &quot;i: &quot; &lt;&lt; i &lt;&lt; std::endl;
      std::cout &lt;&lt; &quot;o: &quot; &lt;&lt; o &lt;&lt; std::endl;
      std::cout &lt;&lt; &quot;u: &quot; &lt;&lt; u &lt;&lt; std::endl;
  }
  </code></pre>