1.

Write a program in C to demonstrate the use of scope resolution operator.

Answer»

The scope resolutions operator is used to find the value of a variable out of the scope of the variable.

Example:

int i=10;

main(){

int i =5;

cout<<::i;

cout<<i;

}

::i refers to the value just before the scope (i.e.10).



Discussion

No Comment Found

Related InterviewSolutions