Does C supports scope resolution? [duplicate]
问题 This question already has answers here : How can I access a shadowed global variable in C? (7 answers) Closed 5 years ago . #include <stdio.h> /* global variable declaration */ int g = 20; int main () { /* local variable declaration */ int g = 10; printf ("value of g = %d %d\n", g,::g); return 0; } When i am trying to run this program. It is throwing error main.c:11:39: error: expected expression before ':' token printf ("value of g = %d %d\n", g,::g); . But if it is written in C++, it works