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 constructor & destructor within the C and C++ forums, part of the Software Development category; What is common & difference in specifying constructor and destructor?...
|
|||||||
|
|||
|
constructor & destructor
What is common & difference in specifying constructor and destructor?
|
| The Following 2 Users Say Thank You to Molugu Natraj For This Useful Post: | ||
| Sponsored Links |
|
|||
|
Re: constructor & destructor
class name is common whereas a tilde sign (~) is a the difference between the two
|
| The Following User Says Thank You to puneet83 For This Useful Post: | ||
|
|||
|
Re: constructor & destructor
Quote:
constructor not contain(~) operator |
|
|||
|
Re: constructor & destructor
Quote:
destuc. is a method exicuted after distroying object. |
|
|||
|
Re: constructor & destructor
when object is created constructor for the class is called that helps in initialising the data members of the class. To which we also sometimes wrongly refer to as 'memory allocation'.
Similarly Destructor is called once the use of the object of the class is finished. So it helps to free the memory occupied by the object, to the system heap. |
| The Following User Says Thank You to diwanshuster For This Useful Post: | ||
![]() |
|
| 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 |
| Constructor | kranti_435 | Java | 1 | 09-01-2008 08:47 AM |
| Copy Constructor | manoj200724 | C and C++ | 7 | 06-15-2008 04:04 PM |
| Constructor and init() | pramod.kuber | Java | 3 | 11-04-2007 02:42 AM |
| why i am getting an error while calling a constructor from another constructor | raj_java_j2ee | Java | 4 | 07-22-2007 03:39 AM |