in reply to
Re: Re: Re: Re: for loop localisation bug?
in thread for loop localisation bug?
I said my Pascal was a long time ago:) I dug up a little info on the last Pascal compiler I used -- in a museum!
For C, I think the info I dug up and posted here is reasonably definitive. With deference to MADuran's info on C99 which I've never encountered, there is no definitive statement on the state of a C for loop variable after a for loop, simply because there is nothing special about a for loop variable in C.
- It is simply a variable that has a scope defined by the block in which it is declared.
- It must have been declared before it can be used in the for loop.
- Any modifications made to it, either by the control statements or within the for loop body, persist after the for loop terminates, and until it goes out of scope.
- It remains in scope, until the block it was defined in, ends.
One all. Now lets get back to perl:)
Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail