Prepare for your Next Interview
|
Welcome to the Geeks Talk forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
This is a discussion on Class copy constructor and assignment operator within the C and C++ forums, part of the Software Development category; Explain why it is essential that a class that dynamically allocate memory in the constructor also needs a properly written copy constructor and assignment operator. Is the above question related ...
|
|||||||
|
|||
|
Class copy constructor and assignment operator
Explain why it is essential that a class that dynamically allocate memory in the constructor also needs a properly written copy constructor and assignment operator.
Is the above question related to memory leaks? How would we know if we have 'improperly' written the copy constructor and assignment operator? What are the pre-emptive measures? "What are the two ways of achieving automatic type conversion from an object of class X into an object of class Y?" Thanks. Question asked by visitor Yves |
| Sponsored Links |
|
|||
|
Re: Class copy constructor and assignment operator
Hi,
class that dynamically allocate memory in the constructor also needs a properly written copy constructor and assignment operator. This is related to Memory Problem. Its Resolved the wild pointer problem when u create new Class pointer and Initialize it with existing class pointer through assignment operator. |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| constructor | emb.mallik | C and C++ | 1 | 03-02-2009 04:50 PM |
| why i am getting an error while calling a constructor from another constructor | raj_java_j2ee | Java | 4 | 07-22-2007 03:39 AM |
| Silent Copy - copy your files with the convenience! | JobHelper | Geeks Lounge | 0 | 04-05-2007 04:40 AM |
| Operator Overloading | sripri | C and C++ | 2 | 12-11-2006 10:12 AM |
| Default and Automatic account assignment | Lokesh M | SAP R/3 | 0 | 12-08-2006 05:37 AM |