what is the difference between class to class type
conversion and copy constructor ?
Answers were Sorted based on User's Feedback
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 |
Answer / ganesh
this copy constructor is coping already existing object
values of same type
| Is This Answer Correct ? | 1 Yes | 1 No |
What are the three parts of a simple empty class?
What are the 4 pillars of oop?
What is constructor overloading in oop?
WAP to generate 2n+1 lines of the following pattern on the computer screen:
What are the four main oops concepts?
why overriding?
Define a class to represent a bank account. Include the following members: Data Members: Name of the Depositor Account Number Type of Account Balance amount in the account Member Functions: To assign the initial values. To deposit an account. To withdraw an amount after checking the balance. Write a C++ main program to display account number, name and balance.
What is overriding in oop?
write knight tour problem which is present in datastructure
What is protected in oop?
What is function overloading?,describe it with the example.
What is data binding?