variable inside loop
- From: A n g l e r <p|k|o|n|i|u|s|z@xxxxxxxxxxxxxxxxxxx>
- Date: Thu, 11 Jun 2009 23:36:07 +0100
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
.
- Follow-Ups:
- Re: variable inside loop
- From: A n g l e r
- Re: variable inside loop
- From: Ben Voigt [C++ MVP]
- Re: variable inside loop
- From: David Lowndes
- Re: variable inside loop
- Prev by Date: Re: Call C# managed method from Unmaged callback
- Next by Date: Re: Call C# managed method from Unmaged callback
- Previous by thread: Call C# managed method from Unmaged callback
- Next by thread: Re: variable inside loop
- Index(es):
Relevant Pages
|