For Programmers: Free Programming Magazines  


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
pete

2006-06-30, 7:56 am

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

2006-06-30, 7:56 am

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
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com