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
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
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
If you have the better answer, then send it to us. We will display your answer after the approval.
   
|