what is the difference between class to class type
conversion and copy constructor ?
Answer Posted / sujatha
CLASS TYPE TO CLASS TYPE:
In class to class type this can be achieved through either
by using TYPE CONVERSIONS OR BY USING CONSTRUCTORS.
here one class object is convrted into another class object
COPY CONSTRuctor:
here we r copying already existing object value to new
object of the same type.
and copy constructor will get called when we are creating
new object of the class at the same time we r intializing
the object with the already existing object.
ex:
A a1; //a1 is object of class A
A a2=a1 //a2 object of class A. a2 is a new object and a1
//is already existing object.
| Is This Answer Correct ? | 8 Yes | 0 No |
Post New Answer View All Answers
2. Give the different notations for the class.\
Where is pseudocode used?
what is graphics
What is overloading and its types?
How do you define social class?
What is the significance of classes in oop?
What does it mean when someone says I oop?
What is destructor in oop?
What is coupling in oops?
What is a class oop?
what are the realtime excercises in C++?
What is static in oop?
if i have same function with same number of argument but defined in different files. Now i am adding these two files in a third file and calling this function . which will get called and wht decide the precedence?
i am getting an of the type can not convert int to int *. to overcome this problem what we should do?
What are the 3 pillars of oop?