Re: Scope of specifier extern
- From: "Tom St Denis" <tomstdenis@xxxxxxxxx>
- Date: 30 Jun 2006 04:55:43 -0700
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;
}
Yes they're the same [at least with GCC on most platforms I can think
of]. "e" will be accessed globally and "int e = 2" exports the symbol
"e".
Now, had you wrote "static int e = 2" they would be different and most
likely platform dependent.
Tom
.
- Follow-Ups:
- Re: Scope of specifier extern
- From: Christian Christmann
- Re: Scope of specifier extern
- References:
- Scope of specifier extern
- From: Christian Christmann
- Scope of specifier extern
- Prev by Date: Re: Scope of specifier extern
- Next by Date: Re: Scope of specifier extern
- Previous by thread: Re: Scope of specifier extern
- Next by thread: Re: Scope of specifier extern
- Index(es):
Relevant Pages
|