title: Understanding an odd looking C++ for loop?
body: <p>I have just encountered some code and I'm not sure why it is done that way.</p>
  <p>Note that this is quite old code, so <code>for (auto i : x)</code> is not an option.</p>
  <p>The code is:</p>
  <pre><code>INT_PTR i,c;
  for(i=0,c=m_array.GetSize();i&lt;c;i++)
  {
    // Do stuff, i &amp; c are not changed inside the loop
  }
  </code></pre>
  <p>Where as I would have done (well I would have used single letter variables, but thats another argument:</p>
  <pre><code>const INT_PTR c = m_array.GetSize();
  for (INT_PTR i = 0; i &lt; c; i++)
  {
    // do stuff
  }
  </code></pre>
  <p>Is there some performance advantage of the first approach that I don't know about?</p>