what is the difference between class to class type
conversion and copy constructor ?

Answers were Sorted based on User's Feedback



what is the difference between class to class type conversion and copy constructor ?..

Answer / 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

what is the difference between class to class type conversion and copy constructor ?..

Answer / ganesh

this copy constructor is coping already existing object
values of same type

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More OOPS Interview Questions

WAP to generate 2n+1 lines of the following pattern on the computer screen:

2 Answers  


What exactly is polymorphism?

0 Answers  


Can we create object of class with private constructor?

5 Answers  


i hav very low percentage in 12th n BSCwhich is around 50.......coz it was just imposed on me 2 b a science graduate,nw m doin MCA n hav aggregate 74% ....what shud i answer if company's HR ask me about dis much low previous percentage??????

3 Answers   Infosys,


what is ltti

1 Answers   Unisys,


What are the main differences between procedure oriented languages and object oriented languages?

9 Answers   IBM, Infosys, Wipro,


Why we use classes in oop?

0 Answers  


write a short note on Overloading of Binary Operator?

2 Answers  


oops concept is used for?

3 Answers   Synergy,


What is the difference between inheritance and polymorphism?

0 Answers  


What is the oops and benefits of oops programming?

0 Answers  


what uses of c++ language?

3 Answers  


Categories