Answer Posted / namitha
A copy constructor is used in the following cases.
-When an object is created from another object of the same
type.
-When an object is passed by value as a parameter to a
function.
-When an object is returned from a pointer.
-when we want to set a default value for the data members.
| Is This Answer Correct ? | 4 Yes | 3 No |
Post New Answer View All Answers
What is cin clear () in c++?
What is the last index number in an array of 100 characters a) 100 b) 99 c) 101
Can you be able to identify between straight- through and cross- over cable wiring? And in what case do you use straight- through and cross-over?
What doescout<<(0==0) print out a) 0 b) 1 c) Compiler error: Lvalue required
What is the use of cmath in c++?
How do you initialize a string in c++?
What is the use of bit fields in structure declaration?
What is microsoft c++ redistributable?
What is the purpose of ios::basefield in the following statement?
What is object in c++ wikipedia?
Describe exception handling concept with an example?
What is difference between class and structure in c++?
What is the best c++ ide?
Explain what is polymorphism in c++?
What is protected inheritance?