duplicate variables outside braces
<p>My teacher gave me a question (С++):
What will be printed on the screen after:</p>

<pre><code>{
     int a = 2;
     cout &lt;&lt; a &lt;&lt; endl;
     {   
         int a=7;
         cout &lt;&lt; a &lt;&lt; endl;
     }
     cout &lt;&lt; ++a &lt;&lt; endl;
}
</code></pre>

<p>And I wonder is there something complicated? Or just duplicated identifier a? Or such braces everywhere do any specific effect and it may go without error? Like in functions when variables do not exist outside. Can it be so outside the block of braces? What are these braces for?</p>
