title: How to capitalize the first letter of each name in an array?
body: <p>Here is the question:</p>
  <p>Create a function that takes an array of names and returns an array where only the first letter of each name is capitalized.</p>
  <p>example</p>
  <p>capMe([&quot;mavis&quot;, &quot;senaida&quot;, &quot;letty&quot;]) ➞ [&quot;Mavis&quot;, &quot;Senaida&quot;, &quot;Letty&quot;]</p>
  <p>And the code I wrote to answer this question:</p>
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;vector&gt;
  
  using namespace std;
  
  void capme(vector&lt;string&gt; name)
  {
      char ch;
      for(int i = 0; i &lt; name[i].size(); i++)
      {
          putchar(toupper(name[i][0]));
          cout &lt;&lt; name[i] &lt;&lt; endl;
      }
  }
  
  int main()
  {
  
     vector &lt;string&gt; name = {&quot;mavis&quot;, &quot;senaida&quot;, &quot;letty&quot;};
     capme(name);
     return 0;
  }
  
  </code></pre>
  <p>As you can see, it prints &quot;Mmavis&quot;, &quot;Ssenaida&quot;, &quot;Lletty&quot;, which is wrong. Can you guys help me in answering this question as I don't know how?</p>