CoolInterview.com - World's Largest Collection of Interview Questions
Send Free SMS
 Interview Questions  
 Our Services  


INTERVIEW QUESTIONS LANGUAGES C++ DETAILS
Question :
What is a scope resolution operator?



Category C++ Interview Questions
Rating (4.5) By 2 users
Added on 7/19/2006
Views 2115
Rate it!
Answers:

The scope resolution operator untangling a mess made by using
the same names for different kinds of entities

base class overridden member function using the scope resolution operator (: :):

The Fundamentals of C++ mt x,y; mt const * p; ... You can use the
scope resolution operator (::) to specify the desired identifier.



The scope resolutions operator is also 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).



 Posted by: Manas Ranjan Padhy    

Contact Manas Ranjan Padhy  Contact Manas Ranjan Padhy

scope resolution operator is used to access the global variables when they are declared by the same name as that of the local variables.



 Posted by: KHEM RAJ    

Contact KHEM RAJ  Contact KHEM RAJ

The scope resolution operator :: is used for the following :

1. access a data member of the parent class form the base class.

2. define a function for a class that is outside that class.



 Posted by: Bharat Shivram    

Contact Bharat Shivram  Contact Bharat Shivram


If you have the better answer, then send it to us. We will display your answer after the approval.
Name :*
Email Id :*
Answer :*
Verification Code Code Image - Please contact webmaster if you have problems seeing this image code Not readable? Load New Code
Process Verification  Enter the above shown code:*
Inform me about updated answers to this question

   
Related Questions
View Answer
What do you mean by inheritance?


View Answer
What is the difference between an object and a class?


View Answer
What is encapsulation?


View Answer
what is defference between constructor and destructor


View Answer
Can you explain the term "resource acquisition is initialization?"

View Answer
What is the difference between operator new and the new operator?

View Answer
How can you force instantiation of a template?

View Answer
What is an algorithm (in terms of the STL/C++ standard library)?


View Answer
What is the output of printf ("%d")


View Answer
What will happen if I say delete this


View Answer

Please Note: We keep on updating better answers to this site. Subscribe to our newsletter to get notified when better answer is posted.

Notify me when better answer is posted!
Email:

View ALL C++ Interview Questions

User Options
Sponsored Links


Copyright ©2003-2010 CoolInterview.com, All Rights Reserved.
Privacy Policy | Terms and Conditions
Page URL: http://www.coolinterview.com/interview/6140/default.asp?cachecommand=bypass


Download Yahoo Messenger | Placement Papers| FREE SMS | ASP .Net Tutorial | Web Hosting | Free SMS | Dedicated Servers | Joke of the Day

0.69