[Updated] Goldman Sachs Aptitude Test Questions and Answers
Practice List of TCS Digital Coding Questions !!!
Take 50+ FREE!! Online Data Interpretation Mock test to crack any Exams.

Technical Discussion :: C++

15. What is the scope resolution operator? Explain how does it work in c++?

Answer:

The :: operator links a class name with a member name in order to tell the complier what class the member belongs to. It has another use that is it can allow access to a name in an enclosing scope that is hidden by a local declaration of the same name.

Egname.
Eg:
Void f()
{
int I;
I=10;
………..
……..
}
It may do so by preceding the I with the :: as shown here
Void f()
{
int I;
:: I=10;
……..
……..
}

Asked In :: iGate

Post Your Answer Here:

Name *
Email
Alert me

Post Your Reply Here:

Report Error

Please Login First Click Here