What's does this c++ code mean?
<p>I'm just starting to learn C++ and I want to know what this code means line-by-line.</p>

<pre><code>string s;
    char *c;
    char input;
    int counter = 0;
    string::size_type len;
    cout &lt;&lt; "Enter a string" &lt;&lt; endl;
    cin &gt;&gt; s;
    len = s.length();
    cout &lt;&lt; "len = " &lt;&lt; len &lt;&lt; endl;
    c = new char[len];
    for (int i = 0; i &lt; len; i++)
     c[i] = s[i];
    cout &lt;&lt; "enter a character to search for " &lt;&lt; endl;
    cin &gt;&gt; input;
    for (int i = 0; i &lt; len; i++)
     if (c[i] == input)
      counter ++;
    cout &lt;&lt; "number of matches are: " &lt;&lt; counter &lt;&lt; endl;
system("PAUSE");
return EXIT_SUCCESS;
</code></pre>

<p>A friend of mine wrote this code, but I'm having some trouble understanding what it all means. Can anybody explain what this code is doing step-by-step please.</p>
