[DGD] Re: Accessing local variables of identical names

Erwin Harte harte at is-here.com
Sun Mar 6 22:12:02 CET 2005


On Sun, Mar 06, 2005 at 05:54:11PM +0000, Robert Forshaw wrote:
[...]
> while() {
>    int i;
> 
>    while() {
>        int i;
> 
>    }
> }
[...]
> My question is, is it possible to access the outer variable i from within 
> the inner block, instead of the variable i declared within that block, and 
> if so, how?

Your one and only option is to rename one of the variables so that
there is no name conflict anymore.

Cheers,

Erwin.
-- 
Erwin Harte <harte at is-here.com>



More information about the DGD mailing list