Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...


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

c++ provides classes...and classes do what we want but why then strcut are used...if we say data hiding... it is also provided by c++ in structs then why to prefer clasess

1 Answers   HCL, TCS,


IN PROGRAMING LANGAUGE A C++ IS PURELY OBJECT ORIENTED OR NOT?

2 Answers  


What is encapsulation in simple terms?

0 Answers  


What is the real time example of encapsulation?

0 Answers  


What are the data types in oop?

0 Answers  






What is variable example?

0 Answers  


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...

0 Answers  


what is the difference between virtual function and destoctor?

1 Answers  


can inline function declare in private part of class?

1 Answers  


How do you define social class?

0 Answers  


explain dynamic binding by drowing

2 Answers   Cognizant,


What is namespace?

15 Answers  






Categories