title: Counting number of syllables in a word, but taking into account that any vowels right next to each other in a word count as one single syllable
body: <p>I've been able to count number of syllables in a word by making a simple nested for loop, but can't figure out how to rewrite such an algorithm that ensures any multiple vowels right next to each other in a word count as just one syllable. I've only come across one other example using pointers, my question is if there's any other approach as I just started learning pointers this week and am not sure how to use them properly.</p>
  
  <p>This is my program so far:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  
  
  using namespace std;
  
  void indexfx(string sentence);
  
  int main(void)
  {
     string user;
     cout &lt;&lt; "\n\nPlease Enter a Sentence: ";
  
     getline(cin, user);
  
     indexfx(user);
  
  
  
  
     return 0;
  }
  
  
  void indexfx(string sentence)
  {
     string vowels = "aeiouy";
     int syllables = 0;
  
     for(unsigned int i = 0; i &lt; sentence.size(); i++)
     {
        for(unsigned int j = 0; j &lt; vowels.size(); j++)
        {  
           if(sentence[i] == vowels[j]
           {
              syllables++;
           }
        }
     }
  
     cout &lt;&lt; syllables;
  }
  </code></pre>