I am working on a project where there is a lot of old code written for Windows.
On several places in the code i run in to the following situation.
| for(int i=0;i < 10; i++)
{
// does stuff
}
// a couple of lines
for(i=0; i < 20; i++)
{
// does stuff with variable i that was declared in the previous for-loop
}
|
The compiler throws an error at me saying i is not declared for the second for-loop. I am willing to agree with the compiler.
But since this code has been around for a long time I am suspecting that this actually worked at some time.
My question is if this was a thing in old-style C or C++? For me it looks really odd.
Sorry for getting off the topic of Handmade hero in this post I just thought this was a good forum to ask this type of question.
Also, love this project and I want to thank Casey for clarifying so much stuff.