Hi,
--
Ignacio Machin
http://www.laceupsolutions.com
Mobile & warehouse Solutions.
"Dom" <do********@gmail.comwrote in message
news:0e**********************************@d27g2000 prf.googlegroups.com...
>I should know this, but I don't. In the following, is an integer
being created with each iteration?
No, only 1 position in reserved in memory for the variable.
for (...)
{
int n = SomeFunction ();
}
Or should I do the following, even if I don't plan to use "n" outside
the loop?
You will have the same memory comsuption in both cases. but they are not the
same!
In this second case the variable can be referenced outside the for loop. In
the first case n only exist inside the loop.
int n;
for (...)
{
n = SomeFunction ();
}