Here is my code , I want to print 15 and 12 but due to instance member hiding the local value of a is getting printed twice.
#include
Use the extern specifier in a new compound statement.
extern
This way:
#include int a = 12; int main(void) { int a = 15; printf("Inside a's main local a = : %d\n", a); { extern int a; printf("In a global a = %d\n", a); } return 0; }