strcmp(x, str) is wrong?
<p>As a beginner of C++, I feel so puzzled on this point for a long time, the program is to tell the appearing times of each word in a string.</p>

<pre><code>#include &lt;iostream&gt;
#include &lt;string&gt;
#include &lt;vector&gt;

using namespace std;

int main()
{
    string x;
    vector&lt;string&gt; str;
vector&lt;int&gt; t;
while (cin &gt;&gt; x)
{
    int k = 0;
    for (int j = 0; j != str.size(); j++)
    {
        if (strcmp(x,str[j]) == 0)
            t[j]++;
        k = 1;
    }
    if (k == 0)
    { 
        str.push_back(x);  
        t.push_back(1);     
    }  

}

for (int i = 0; i != str.size(); i++ )
{
    cout &lt;&lt; str[i] &lt;&lt; "   " &lt;&lt; t[i] &lt;&lt; endl;
}

return 0;
}
</code></pre>

<p>Here is the error:</p>

<pre><code>C++\code\3.3.cpp(17) : error C2664: 'strcmp' : cannot convert parameter 1 from 'class std::basic_string&lt;char,struct std::char_traits&lt;char&gt;,class std::allocator&lt;char&gt; &gt;' to 'const char *'
        No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
</code></pre>

<p>I find no result on the Internet after a long-time searching. How can I fix this?</p>
