Is there any performance penalty for the following code snippet?
for (int i=0; i
In today's compilers, no. I declare objects in the smallest scope I can, because it's a lot more readable for the next guy.