title: How do I fix "for loop initial declaration used outside C99 mode" GCC error?
body: <p>I'm trying to solve <a href="http://uva.onlinejudge.org/external/1/100.pdf" rel="noreferrer">the 3n+1 problem</a> and I have a <code>for</code> loop that looks like this: </p>
  
  <pre><code>for(int i = low; i &lt;= high; ++i)
          {
                  res = runalg(i);
                  if (res &gt; highestres)
                  {
                          highestres = res;
                  }
  
          }
  </code></pre>
  
  <p>Unfortunately I'm getting this error when I try to compile with GCC:</p>
  
  <blockquote>
    <p>3np1.c:15: error: 'for' loop initial
    declaration used outside C99 mode</p>
  </blockquote>
  
  <p>I don't know what C99 mode is. Any ideas?</p>