confused with the scope in c#
<p>I have two samples:</p>

<p><strong>Code 1</strong></p>

<pre><code>public void MyMethod(){
    int i=10;

    for(int x=10; x&lt;10; x++){
        int i=10; //Point1 complier reports error
        var objX = new MyOtherClass();
    }

    var objX = new OtherClassOfMine(); //Point2  complier reports error
}
</code></pre>

<p>I understand compiler reporting error at point 1 But i dont understand why it reports error at point2; and if you say because of the organizaion inside MSIL then why code second compiles</p>

<p><strong>Code sample 2</strong></p>

<pre><code>public void MyMethod(){

    for(int x=10; x&lt;10; x++) {
        int i=10; 
        var objX = new MyOtherClass();
    }

    for(int x=10; x&lt;10; x++) {
        int i=10; 
        var objX = new MyOtherClass();
    }
}
</code></pre>

<p>If the simple rules of scope applies in Code sample 2 than why is it different in Code sample 1?</p>
