Home > Archive > C > June 2006 > Re: Scope of specifier extern
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Re: Scope of specifier extern
|
|
|
| Christian Christmann wrote:
>
> Hi,
>
> I've a a question on the specifier extern.
>
> Code example:
>
> void func( void )
> {
> extern int e;
> //...
> }
>
> int e = 2;
>
> int main() void
> {
> func();
> return 0;
> }
>
> Are both the func() variable 'e' and the global 'e' same
> objects? Or are they distinct symbols due to different
> scopes (one is local, the other is global)?
> I could not find any references in the standard ISO/IEC 9899:1999.
The meaning of "extern int e;" is that e is defined
as an int, outside of the block with the extern declaration.
--
pete
| |
|
| pete wrote:
>
> Christian Christmann wrote:
>
> The meaning of "extern int e;" is that e is defined
> as an int, outside of the
> block with
Should be "scope of" instead of "block with"
> the extern declaration.
--
pete
|
|
|
|
|