Compile error when using std::cout between if/elseif statements : <p>I was wondering why I get a compile error when I try to use std::cout in between, say, an if statement and else if statement.
For example:</p>

<pre><code>if (condition)
{body}
std::cout &lt;&lt; "hello world" &lt;&lt; std::endl;
else if (condition)
{body}
</code></pre>

<p>Gives the error </p>

<pre><code>error: 'else' without a previous 'if'
</code></pre>
