Explain scope resolution operator in c++
Answers
Answered by
0
Scope resolution operator is C++ is the only operator which is used to qualify hidden names so that you can still use them.
You use unary scope operator if namespace global scope is hidden by an explicit declaration of same name in block.
Example of it :-
#include<iostream>
using namespace std;
int x;
int main()
{
int x = 10;
cout << "Value of global x is " << ::x;
cout << "Value of local x is " << x;
return 0;
}
Similar questions
Physics,
7 months ago
Computer Science,
7 months ago
Business Studies,
1 year ago
English,
1 year ago