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
What is the difference between a mixin and inheritance?
What is protected in oop?
I have One image (means a group photo ) how to split the faces only from the image?............ please send the answer nagadurgaraju@gmail.com thanks in advace...
Write a c++ program to display pass and fail for three student using static member function
What language is oop?
Question In a class, there is a reference or pointer of an object of another class embedded, and the memory is either allocated or assigned to the new object created for this class. In the constructor, parameters are passed to initialize the data members and the embedded object reference to get inialized. What measures or design change should be advised for proper destruction and avioding memory leaks, getting pointers dangling for the embedded object memory allocation? Please suggest. Question Submitted By :: Sunil Kumar I also faced this Question!! Rank Answer Posted By Re: In a class, there is a reference or pointer of an object of another class embedded, and the memory is either allocated or assigned to the new object created for this class. In the constructor, parameters are passed to initialize the data members and the embedded object reference to get inialized. What measures or design change should be advised for proper destruction and avioding memory leaks, getting pointers dangling for the embedded object memory allocation? Please suggest. Answer # 1 use copy constructors 0 Shanthila There is something to be taken care in destructor, in copy constructor, suppose the memory is assigned to the embedded member object pointer with the parameter passed value, but if some other objects of different class also are pointing to this memory, then if some one deletes the object then this class member pointer object will become dangling, or if the object is not deleted properly then there will be memory leak. Please suggest the design change required to handle or avoid this situation
What are different types of JVM's? for example we use dalvik jvm for android then what about the remaining operating systems?
Which language is pure oop?
Is this job good for future? can do this job post grduate student?
class type to basic type conversion
What are main features of oop?
What is the oops and benefits of oops programming?
Is oop better than procedural?
hi all..i want to know oops concepts clearly can any1 explain??
What is object in oop with example?