They see only their own. A variable cannot be "visible" from outside the scope in which it was declared.
If, on the other hand, you did this:
static int x; void foo() { static int x; } int main() { foo(); }
then foo() sees only local x ; global x was "hidden" from it. But changes in one do not affect the meaning of the other.
Oliver Charlesworth
source share