in `while`, why i cannot declare variable in the condition just like we do in`for`?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/1581364/why-cant-we-define-a-variable-inside-a-while-loop">why can&#39;t we define a variable inside a while loop?</a>  </p>
</blockquote>



<p>I would like to simplify the following code:</p>

<pre><code>string line;
while ((line = sr.ReadLine()) != null)
</code></pre>

<p>into:</p>

<pre><code>while ((string line = sr.ReadLine()) != null)
</code></pre>

<p>but failed.</p>

<p>However, we surely can do this in <code>for</code>:</p>

<pre><code>for (int i=0, int n=50;i&lt;n;i++)
</code></pre>
