What is a scope resolution operator?

Answer Posted / vikram

scope resolution operator(::) is used to define member
functions outside the class,that is we are defining the
member functions explicitly.
Scope resolution operator is also used to access the
globally declared variables.
for example,
#include<iostream.h>
int a=20;
main()
{
int a=10;
cout<<a<<endl<<::a;
}
here,the output will be:
10
20
thnx

Is This Answer Correct ?    38 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a null tree?

632


write a program using c++ to implement single contiguous memory mangement techniques.display the content of the main memory after yhe allocation of jobs and percentage of the wastage of the main memory

2763


What is data binding in oops?

588


What do you mean by abstraction?

616


What are the components of marker interface?

602






They started with the brief introduction followed by few basic C++ questions on polumorphism, inheritance and then virtual functions. What is polymorphims? How you will access polymorphic functions in C? How virtual function mechanism works?

1395


What is abstract class in oops?

600


What is this pointer in oop?

557


Write a program to reverse a string using recursive function?

1792


Can you inherit a private class?

631


what is difference between class template and template class?

2157


What are main features of oop?

633


write a program to find 2 power of a 5digit number with out using big int and exponent ?

1895


write a program that takes input in digits and display the result in words from 1 to 1000

1989


Is enum a class?

607