Answer Posted / amar
Copy constructors is used in following cases.
1) When object is passed by values to a fucntion
2) when function returns object by value
3) When new object is created from exixting object using
overlaoded = operator.
If user has not defined its own copy constructor, compiler
synthesised constructor would be called which will do
shallow copy. So if you have pointer in your class then only
the pointer value is copied and not the contents which
pointer points to.
Is This Answer Correct ? | 12 Yes | 5 No |
Post New Answer View All Answers
If we want that any wildcard characters in the command line arguments should be appropriately expanded, are we required to make any special provision? If yes, which?
What would happen on forgetting [], while deallocating an array through new?
What causes a runtime error c++?
What is the difference between the indirection operator and the address of oper-ator?
What are arithmetic operators?
what is pre-processor in C++?
What is an undefined reference/unresolved external symbol error and how do I fix it?
Explain how functions are classified in C++ ?
What are default parameters? How are they evaluated in c++ function?
What is a lambda function c++?
What is lambda in c++?
Define a nested class. Explain how it can be useful.
I want explanation for this assignment: how to connect mysql database using c/c++,please explain this detailly?
Explain operator overloading.
Explain the virtual inheritance in c++.