This is the mail archive of the
mailing list for the GCC project.
Declaring automatic variables inside a while loop
- From: "Swaminathan Venkatakrishnaprasad" <vswami at agere dot com>
- To: <gcc at gnu dot org>
- Date: Tue, 20 Jan 2004 17:59:56 -0500
- Subject: Declaring automatic variables inside a while loop
Could you please let me know if it is
valid to declare an automatic variable
inside a for loop. If yes, is it also allowed
in ANSI standard (could you please refer
me to the sec #).
i = 10;
while(i >=0 )
printf("j=%d \n", j);
Also, in the above example would
the number of iterations contribute anything to the stack
size since an automatic variable is declared
inside the while loop??
Your input is very much appreciated.
Thanks & Regards,