0
Here what's the meaning of cout<<::x
#include <iostream> using namespace std; void fun(); int x=1; int main() { fun(); return 0; } void fun(){ int x=2; { int x=3; cout<<::x; } } output is 1
1 Answer
+ 6
:: is a scope resolution operator. ::x accesses the value of the global x, instead of the local x in the function.