Author Topic: something about constructors and destructors  (Read 4288 times)

Yap Michael

  • User
  • *
  • Posts: 8
something about constructors and destructors
« on: February 13, 2006, 05:00:49 AM »
i want to be clarified with what constructors and destructors mean. Please give me some codes. I want to know more about those things. Thanks!

Gillius

  • Administrator
  • User
  • *****
  • Posts: 147
    • http://www.gillius.org/
something about constructors and destructors
« Reply #1 on: February 13, 2006, 10:54:14 PM »
Constructors and destructors simply just initalize and deinitalize objects.  When you make an object, the constructor is called, and when an object is destroyed, its destructor is called.  Common uses are to allocate memory and resouces in the "ctor" and deallocate them (free them) in the "dtor."

Check out http://www.gillius.org/ooptut/part2.htm#Constructors%20and%20Destructors for a code sample.  If you are still confused, please ask again.
Gillius
Gillius's Programming http://www.gillius.org/