Short Note on Scope Resolution Operator in c++
Scope Resolution Operator :-
This operator can be used in situations where a global variable exist with the same name as a local variable.
Example :-
#include <stdio.h>
int xyz=50; // global variable
int main ()
{
for(register int xyz=1;xyz<10;xyz++)
// Here xyz is local variable
{
printf(“%d,::xyz/xyz”); //local variable
}
returnno();
}
In this code fragment the scope resolution operator is used to address a global variable instead of the local variable with the same name.
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment