Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<pre><code>if(strlen(str) + (strlen(ss.str) &lt; sz) </code></pre> <p>should be</p> <pre><code>if(strlen(str) + strlen(ss.str) &lt; sz) </code></pre> <p>Notice how you have 4 <code>(</code> but only 3 <code>)</code> in the original line. These need to match up, but they don't. Since the <code>(</code> before the second <code>strlen()</code> is superfluous (there is no need to wrap <code>strlen(ss.str)</code> in brackets), you can remove it.</p> <p><a href="http://ideone.com/4e2Bh" rel="nofollow noreferrer">Original code with changes to the <code>#include</code>s</a> and <a href="http://ideone.com/gCPxh" rel="nofollow noreferrer">fixed code</a>. Note that I had to change the <code>#include</code>s from <code>string.h</code> to <code>cstring</code> for ideone. It's the preferred choice anyway. I also had to add <code>using namespace std;</code> as your code wasn't explicitly using the <code>std</code> namepsace where required, e.g. using <code>cout</code>. You should also <a href="https://stackoverflow.com/questions/59670/how-to-get-rid-of-deprecated-conversion-from-string-constant-to-char-warning">take care of those warnings</a>.</p> <p>The reason the compiler error points to 4 lines down is because that's the line where it realises "Oh no, there's a problem here I'm never going to be able to parse this code!" GCC is pretty crappy at error reporting, but a but a compiler (e.g. clang) that does a better job of it would backtrack to the appropriate line where the root cause of the error actually lies and may even suggest a fix for you.</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