Why did I get error by using strchr() in C++? : <pre><code>#include &lt;iostream&gt;
#include &lt;string&gt;
#include &lt;cstring&gt;
using namespace std;

int main(){
    string a="asdasd";
    if(!strchr(a,'a')) cout&lt;&lt;"yes";
    return 0;
} 
</code></pre>

<p>I just began to learn C++ programming and I don't know why I got error in this line </p>

<pre><code>if(!strchr(a,'a')) cout&lt;&lt;"yes";
</code></pre>

<p>But if I tried to code it like this, it would run very well.</p>

<pre><code>if(!strchr("asdasd",'a')) cout&lt;&lt;"yes";
</code></pre>

<p>I know it is a stupid question but I really don't know why.. sorry..</p>
