A
A n g l e r
Dear all.
I guess the following is somewhat VC specific question ...
Imagine such a code:
for (int a=0; a<1000; a++)
{
int b;
//<== operations on b
}
I've been wondering if there is any speed related benefit if I had
declared variable b outside of the loop. So far I haven't spotted any
difference in case of basic types. Otherwise, constructor evoked dozens
of times would take up loads of the processing time. Can anyone
elaborate on how VC copes with variables of basic types declared inside
loops rather than outside?
Cheers,
Peter
I guess the following is somewhat VC specific question ...
Imagine such a code:
for (int a=0; a<1000; a++)
{
int b;
//<== operations on b
}
I've been wondering if there is any speed related benefit if I had
declared variable b outside of the loop. So far I haven't spotted any
difference in case of basic types. Otherwise, constructor evoked dozens
of times would take up loads of the processing time. Can anyone
elaborate on how VC copes with variables of basic types declared inside
loops rather than outside?
Cheers,
Peter