title: Variable inside for loop not re-initialized on each iteration?
body: <p>I have a C++/CLI project that declares a String^ variable inside a for loop but does not initialize it. On the first iteration, the variable is set to some value. On each subsequent 
  iteration, it appears to be retaining the previous value. Shouldn't a variable in local scope be initialized to null (or equivalent) each time thru the loop? This happens with an int as well. Also, the compiler 
  does not warn of a potentially uninitialized value unless I set the warning level to W4, and even then it only warns for the int and not the String^.</p>
  
  <p>This is sample code that shows the behavior.</p>
  
  <pre><code>#include "stdafx.h"
  using namespace System;
  
  int main(array&lt;System::String ^&gt; ^args)
  {
      for(int n = 0; n &lt; 10; n++)
      {
          String^ variable;
          int x;
  
          switch(n)
          {
          case 1:
              variable = "One";
              x = 1;
              break;
          case 5:
              variable = "Five";
              x = 5;
              break;
          }
  
          Console::WriteLine("{0}{1}", variable, x);
      }
  }
  </code></pre>
  
  <p>The output of this will be </p>
  
  <pre><code>One, 1
  One, 1
  One, 1
  One, 1
  Five, 5
  Five, 5
  Five, 5
  Five, 5
  Five, 5
  </code></pre>
  
  <p>Am I completely misunderstanding how locally scoped variables are supposed to be initialized? Is this a "feature" unique to managed C++? If I convert 
  this to C# the compiler will warn about both variables, even at the base warning level.</p>