So I read that:
An identifier’s linkage determines whether other declarations of that name refer to the same object or not.
and that variables especially local ones:
have no linkage
int main()
{
int x;
{
int x;
}
}
- Concerning the fact that local variables have no linkage is it because when we declare a variable it also defines it, and so both x declarations will never refer to the same object(or else naming collision will occur)?
- Can a local variable have linkage if it is specified as
extern
?
Thanks in advance.