Answer Posted / madhu
Basic thing, copy constructor will be called whenever a copy
is made. and copy constructors are called when:
1. create a new object using existing object.
2. When is returning to caller.
3. When an object is passed by value as a parameter to a
function
Basically a default copy constructor will be created which
does bitwise copy also know as shallow copy.
This will become a problem when we are dealing with dynamic
memory allocation for variables and leads to dangling pointer.
To overcome we have to override by deep copy.
Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
just right the logic of it 1--> If few people are electing then every time ur candidate should win 2--> arrange books in box, if box carry weight == books weight then take another box..... find the no of box required.
What is overriding vs overloading?
What is the purpose of polymorphism?
How oops is better than procedural?
What is new keyword in oops?
What is multilevel inheritance explain with example?
What is encapsulation example?
What is the point of oop?
What is the difference between inheritance and polymorphism?
What is the difference between static polymorphism and dynamic polymorphism?
What is encapsulation and abstraction? How are they implemented in C++?
design a c++ class for the chess board,provide a c++ class definition for such class(only class definition is required)
What is abstraction oop?
2. Give the different notations for the class.\
class CTest { public: void someMethod() { int nCount = 0; cout << "This is some method --> " << nCount; } }; int main() { CTest *pctest; pctest->someMethod(); return 0; } It will executes the someMethod() and displays the value too. how is it possible with our creating memory for the class . i think iam not creating object for the class. Thanks in Advance... Prakash