By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,159 Members | 888 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,159 IT Pros & Developers. It's quick & easy.

C++ programming

P: 2
Hi, i want to ask about constructors and destructors in c++
Apr 5 '07 #1
Share this Question
Share on Google+
4 Replies


Expert 10K+
P: 11,448
Hi, i want to ask about constructors and destructors in c++
Please feel free to do so.

kind regards,

Jos
Apr 5 '07 #2

P: 94
Expand|Select|Wrap|Line Numbers
  1.  
  2. class name{
  3.                           public:
  4.                                      name();  // constructor
  5.                                      ~name(); // deconstructor
  6.  
what do you want to know?
Apr 5 '07 #3

P: 22
Hi, i want to ask about constructors and destructors in c++
tel yar.. what u want wheter definiton r anything else....
Apr 5 '07 #4

P: 1
Hi, i want to ask about constructors and destructors in c++
Class name and constructor names are same. Destructor gets a ~ symbol before the name.

When the object creates the contructor invoked .
when the object delets the destructor invoked.

Mostly contructor used to allocate the memory and initiate the members.
Destructor used to deallocate the memory.
Apr 5 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.