title: ANSI C vs other C standards
body: <p>On several compilers I have used (all <code>gcc</code> but various versions) I get a <code>C99 mode</code> error for things like declaring <code>int i</code> inside the for loop expression instead of before it (if I do not use the <code>std=c99</code> option).  After reading <a href="http://gcc.gnu.org/onlinedocs/gcc-4.0.4/gcc/Standards.html" rel="noreferrer">here</a> I understand that the <code>gcc</code> options <code>-ansi</code>, <code>-std=c89</code>, and <code>-std=iso9899:1990</code> all evaluate to the ANSI C standard, <strong>but I don't understand why/if I should pick the <code>c89</code> standard versus a newer standard like <code>c99</code> (which is the newest I assume).</strong></p>
  
  <p>Also, I see multiple versions of the <code>iso</code> type standards for the C language, the first of which (from my understanding) is a direct port of the ANSI standard.  <strong>Is is safe to say that <code>iso</code> will update their standard for C but the original ANSI standard for C will always be the same?</strong></p>
  
  <p><strong>Bonus question:</strong></p>
  
  <p>I can actually figure this one out myself, I just haven't taken the time to do it yet, so if someone knows off the top of their head then that is great, otherwise no biggie, I'll figure it out later :)</p>
  
  <p>I have a fairly new print of the book <code>The C Programming Language (ANSI)</code>.  My book always shows for loops like this:</p>
  
  <pre><code>int i;
  
  for(i = 0; i &lt; foo; i++)
  </code></pre>
  
  <p>but many people (most of who have more programming talent in their little finger) write their for loops like this:</p>
  
  <pre><code>(int i = 0; i &lt; foo; i++)
  </code></pre>
  
  <p>Is it correct to say if I write the loop the first way then <code>i</code> should be accessible to the entire function, but if I write it the second way then <code>i</code> is only accessible to the for loop <strong>REGARDLESS</strong> of what standard I compile with?  Another way of asking this same question, if I compile with the <code>c89</code> standard will the <code>i</code> of both for loops be accessible to the entire function and if I compile with the <code>c99</code> standard will the <code>i</code> of the first for loop be accessible to the entire function while the <code>i</code> of the second for loop will be accessible by only the for loop?</p>