But I think it is impossible to write such a and b. Can anyone explain this?
It is possible - visibility of the object depends on the scope too, bot only linkage and storage duration.
int a = 1;
static char b = 2;
void y(int a)
{
//global a is not accessible here
}
//or
void y(void)
{
int a;
//global a is not accessible here
}
void x(void)
{
}