title: count vowels in a string with recursion function
body: <p>I am currently in my last year of a BS in Information Systems with a major in programming. I took and passed C++ programming 1. I am now in C++ programming 2 and am having trouble with recursive functions. We have a homework assignment, where we are suppose to write a program that will count the number of vowels in a string that is entered by the user. 
  I have a program similar to this from my C++ programming 1 class that works using a for loop and if-then statements. I had assumed that it would be easy to convert this working program to use a recursive function, I was wrong.
  I have the code (not looking for someone to do it for me) and I think i have it setup right. Just am not sure where to put the call to the function within the function.
  Can somebody point me in the right direction?`
  This is my first time asking a question. If i attached my code wrong, please let me know.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;cctype&gt;
  
  using namespace std;
  
  int vowelCount(string, int, int&amp;);
  
  int mail()
  {
  string input;
  int len;
  //int x;
  //int y;
  int count;
  
  count = 0;
  
  cout &lt;&lt; "Enter a string of characters with no spaces: ";
  cin &gt;&gt; input;
  len = input.length();
  
  vowelCount(input, len, count);
  
  cout &lt;&lt; "There were " &lt;&lt; count &lt;&lt; " vowels." &lt;&lt; endl;
  
  system("pause");
  return 0;
  }
  
  int vowelCount(string input, int len, int&amp; count)
  {
  int y;
  int x;
  
  y = input.at(len);
  if (len == 1)
  {
      count = count + 1;
      return count;
  }
  else
  {
      y = input.at(len);
      if ((y == 'a') || (y == 'e') || (y == 'i') || (y == 'o') || (y == 'u')         || (y == 'A') || (y == 'E') || (y == 'I') || (y == 'O') || (y == 'U'))
      {
          count = count + 1;
          len = len - 1;
      }
          else
          {
              len = len - 1;
              vowelCount(string input, int len, int&amp; count);
              return count;
          }
      }
  
  }
  return 0;
  }
  </code></pre>