Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>These are the errors I obtain trying to compile your code:</p> <pre><code>&gt; g++ main.cc -std=c++0x main.cc: In function ‘char* converttostring(int)’: main.cc:24:15: error: ‘std::stringstream’ has no member named ‘c_str’ main.cc: In function ‘int cst_cmp(const void*, const void*)’: main.cc:31:23: error: invalid conversion from ‘char’ to ‘const char*’ [-fpermissive] /usr/include/string.h:143:12: error: initializing argument 1 of ‘int strcmp(const char*, const char*)’ [-fpermissive] main.cc:31:23: error: invalid conversion from ‘char’ to ‘const char*’ [-fpermissive] /usr/include/string.h:143:12: error: initializing argument 2 of ‘int strcmp(const char*, const char*)’ [-fpermissive] main.cc: In function ‘int main()’: main.cc:55:23: error: invalid initialization of reference of type ‘std::vector&lt;std::basic_string&lt;char&gt; &gt;&amp;’ from expression of type ‘std::vector&lt;char*&gt;’ main.cc:35:6: error: in passing argument 1 of ‘void textvect(std::vector&lt;std::basic_string&lt;char&gt; &gt;&amp;, int)’ </code></pre> <p>24:15 <code>c_str()</code> is a member function of <code>string</code> not of <code>stringstream</code>. See <a href="http://www.cplusplus.com/reference/string/string/c_str/" rel="nofollow">here</a>.</p> <p>31:23 <code>strcmp()</code> wants two <code>const char *</code> not two <code>char</code>. See <a href="http://www.cplusplus.com/reference/clibrary/cstring/strcmp/" rel="nofollow">here</a>.</p> <p>55:23 and 35:6 <code>char*</code> is not the same type as <code>string</code>.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload