converting string into char
<p>I know I can do this by <code>str.c_str()</code>,
but I do not want a character constant. I want a char so that I can make some modifications.</p>

<pre><code>char* removeDup(char *s)
{


        int len = strlen(s);
        int p,q, idx = -1;
    for(p = 0; p&lt; len; p++)
   {
    char temp = s[p];
    bool flag = true;
    for(q=0;q&lt;p;q++)
    {
        if(s[q] == temp)
        {
            flag = false;
            break;
        }
    }
    if(flag == true)
    {
        s[++idx] = temp;
    }
}
    s[++idx] = '\0';
    return s;
}
</code></pre>

<p>if I call this function as below, I get errors;</p>

<pre><code>string s = "abcde";
removeDuplicate(s.c_str());
</code></pre>

<p>I need to convert this <code>s</code> into <code>char</code> and not <code>const char</code>.</p>
