title: Why does using the same count variable name in nested FOR loops work?
body: <p>Why does the following not give an error?</p>
  
  <pre><code>for (int i=0; i&lt;10; ++i) // outer loop
  {
      for (int i=0; i&lt;10;++i) // inner loop
      {
      //...do something
      }
  //...do something else
  }
  </code></pre>
  
  <p>The way I understand it, variables in braces ({...}) are in scope only within these braces. But the inner loop is inside the braces of the outer loop. So as soon as I declare <code>int i=0</code> for the inner loop, shouldn't I get an error about multiple definitions?</p>