Why is the error "invalid conversion from 'char' to 'const char*"?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/8437099/c-convert-char-to-const-char">C++ convert char to const char*</a>  </p>
</blockquote>



<p>I have a code snippet:</p>

<pre><code>string opposite(string c)
{
    if(c == (string) "\""){return "\"";}
    if(c == (string) "&lt;"){return "&gt;";}
    throw;
}

int load_end(int start, string code)
{
    //start is the begining of "header.h" or &lt;header&gt; in #load "header.h" or #load &lt;header&gt;
    //code is self explanitory
    //This function returns the end of "header.h" or &lt;header&gt; in #load "header.h" or #load

    string chr = " ";
    int e;
    string asdf = opposite(code[start]);
    for(int i = start; chr == asdf; i++)
    {
        e = i;
        chr = code[i];
    }
    return e;
}
</code></pre>

<p>At the line where where the word where 'asdf' is defined the error occurs; "invalid conversion from 'char' to 'const char*" [-fpermissive]". Also another error occurs: "c:\mingw\bin..\lib\gcc\mingw32\4.6.2\include\c++\bits\basic_string.tcc|214|error:   initializing argument 1 of 'std::basic_string&lt;_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&amp;) [with _CharT = char, _Traits = std::char_traits, _Alloc = std::allocator]' [-fpermissive]|". These errors make no sense to me of how they were caused.</p>
