title: Error on Declaring variable in for statement
body: <p>Is declaring a variable within <strong>for</strong> not allowed in C?
  Here is the code,</p>
  
  <pre><code>for(int i = 1; i&lt;max; i++)
  </code></pre>
  
  <p>And I get error messages as,<br/><br/>
  <strong>error C2143: syntax error : missing ';' before 'type'</strong><br/>
  <strong>error C2065: 'i' : undeclared identifier</strong></p>
  
  <p>It works if I declare the variable <strong>i</strong> jut before the for loop,</p>
  
  <pre><code>int i;
  for(i = 1; i&lt;max; i++)
  </code></pre>
  
  <p>I was never expecting an error message on such a simple line of code. Can you please help me explain the reason behind this?</p>
  
  <p><strong>Edit:</strong><br/>
  I've Visual C++ 2010 Express. I'm using the command line compiler <strong>cl</strong>.</p>
  
  <p><strong>Update:</strong><br/>
  Based on replies, I've found Visual C++ 2010 doesn't support C98.</p>
  
  <p>I've finally installed Visual Studio 2013 Express for Desktop which supports C98 and is working as expected. <br/>
  Thanks to all of you for the valuable information. </p>