> Does that mean the following will compile?
>
> 1 void
> 2 f(void)
> 3 {
> 4 i = 3;
> 5 put(i);
> 6 for (int i = 0; i < 3; i++)
> 7 put(i);
> 8 if (i == 4) put(4);
> 9 }
No, because i is undeclared at line 4.
It's still not a good example. Here's a better one:
void
main(void)
{
int i = 100;
for (int i = 0; i < 3; i++)
printf("%d\n", i);
printf("%d\n", i);
}
It prints 0 1 2 100.
Russ
