void myfunction(void)
{
extern int myvariable;
return ;
}
what is the point in allowing local variables to have external linkage?
its scope is only myfunction so it can't be used anywhere else.
The /name/ may have local scope, but the variable it refers to most
certainly will not. This would be something you might choose to do
(personally, I don't think I've ever written a declaration like this) to
bring a file-scope variable defined in, say, other another translation unit
into scope within the body of this function, in case it isn't in scope
already. (Another possibility is that it is brought into file scope /below/
the point where this function is defined.)
Of course, if myvariable is already declared at file scope at the point
where your function definition resides, this would effectively constitute a
no-op declaration.
-leor
Leor Zolman
BD Software
(e-mail address removed)
www.bdsoft.com -- On-Site Training in C/C++, Java, Perl & Unix
C++ users: Download BD Software's free STL Error Message
Decryptor at
www.bdsoft.com/tools/stlfilt.html