expected constructor, destructor, or type conversion before '<<' token
<p>On Compiling follow programs using g++. </p>

<pre><code>#include&lt;iostream&gt;
using namespace std;

cout&lt;&lt;"Before Main"&lt;&lt;endl;

int main()
{
cout&lt;&lt;"Within Main"&lt;&lt;endl;
}
</code></pre>

<p>Errors: expected constructor, destructor, or type conversion before '&lt;&lt;' token.
So may i know how to fixe this.
What's the reason for getting erros.</p>
