I see this in a lot of game engine code. Is this supposed to be faster than if you were to declare it in the for loop body? Also this is followed by many other for loops, each of them using the same variable.
int i;
for(i=0; i<count; ++i)
{
}
vs
for(int i=0; i<count; ++i)
{
}
Btw I never do this myself, just curious about the idea behind it, since apart from performance I don’t know why anyone would do this.
The first way is probably the C way, the OLD OLD C way, where the second version wasn’t valid. Use the second way, scope the variables tight as possible.