Documentation
Output
Local x = 10
Class x = 50
Global x = 100
-
xinsideshow()→ local variable -
this->x→ class data member -
::x→ global variable -
Scope resolution operator helps differentiate variables with same name in different scopes.