Monday, August 16, 2010

Scope Resolution Operator

,
Definition of Scope Resolution Operator:-The scope access(or resolution operator)operator :: (the two semicolons)allow programmers to access a global name even if it is hidden by a local re-declaration of that name.
When we declare a variable it is available only to a specific part or block of the program.Remaining block cannot access the variable .The area of a block where the variable is accessed is known as the scope resolution operator.


Example:-#include
int a=10;
main()
int a=20;
cout<<"::a"<<::a;
cout<<"a="<
return 0;

Result:- 10
20

0 comments to “Scope Resolution Operator”

Post a Comment