Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You need to remove the <code>;</code> in <code>#define INVALID_VALUE -999;</code>. See <a href="http://ideone.com/pnWam" rel="nofollow">the fixed code</a>.</p> <p>You could have worked towards this conclusion by understanding what the error message <code>expected ‘)’ before ‘;’ token</code> was telling you. It's telling you that it expected to find a <code>)</code> before the <code>;</code> token, but from inspecting the line alone you don't see a <code>;</code>. So maybe there's one in the definition of <code>INVALID_VALUE</code>? Look up at <code>#define INVALID_VALUE -999;</code> and there it is! Think it should be there, but not sure? So let's try remove it and see if it works. Success!</p> <p><a href="https://www.securecoding.cert.org/confluence/display/seccode/PRE11-C.+Do+not+conclude+macro+definitions+with+a+semicolon" rel="nofollow">This page</a> goes and explains why you shouldn't conclude a <code>#define</code> with a semicolon, even if it is needed in the use of the macro. It's good to learn as much as possible from your mistake so that you don't make it again. Quote:</p> <blockquote> <p>Macro definitions, regardless of whether they expand to a single or multiple statements should not conclude with a semicolon. If required, the semicolon should be included following the macro expansion. Inadvertently inserting a semicolon at the end of the macro definition can unexpectedly change the control flow of the program.</p> <p>Another way to avoid this problem is to prefer inline or static functions over function-like macros.</p> <p>In general, the programmer should ensure that there is no semicolon at the end of a macro definition. The responsibility for having a semicolon where needed during the use of such a macro should be delegated to the person invoking the macro.</p> </blockquote>
 

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