Is there any difference performance/resource wise between these two solutions? I'm thinking if recreating the x variable continually in the second example will use more resources and slow things down? Or any other disadvantages?
int x;
for (int i = 0; i < 100; i++)
{
x = i;
}
for (int i = 0; i < 100; i++)
{
int x = i;
}