Re: scoping question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Todd <todd.freed@xxxxxxxxx> writes:

> My question is, is it possible, from within the inner scope, to refer
> to the variables and labels defined in the outer scope (whose names
> have been overridden)

If the name of the variable has been overridden, then you can not refer
to the object directly.  This is the same case as

    int i;
    {
      int i;
      i = 1; /* Refers to inner 'i', not outer one.  The outer 'i' is
                hidden.  */
    }

Of course you could use a pointer, pass a parameter to the inner
function, etc.

Ian

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux