Difference of variable declaration in for statement in C
<p>let's assume that it is not only in visual studio but also in C99, C11 and etc.</p>

<p>there are two different ways of declaring variable "i" in for statement.</p>

<pre><code>1) 
int i;
for(i = 0 ; i &lt; index ; ++i) 

2)
for(int i = 0 ; i &lt; index ; ++i)
</code></pre>

<p>Both work same. but I think there will be some difference between them.
Do you have any idea about that?
If yes, please let me know. </p>

<p>I just wondering about your opinion, and how it works differently.</p>

<p>Sorry. for answers, I know that the scope of "i" is different. </p>

<p>Is there any difference in view of system(I mean memory or etc.) or compiler work differently or assembled code is different or something like this.</p>