Thread: Destructors

  1. #1
    x4000 Ruski's Avatar
    Join Date
    Jun 2002
    Location
    Outer Space!
    Posts
    542

    Question Destructors

    I was wondering, is it very useful to put destructors for classes? And what's the purpose of it?
    Thanks
    Last edited by Ruski; 07-16-2002 at 03:19 AM.

  2. #2
    Funniest man in this seat minesweeper's Avatar
    Join Date
    Mar 2002
    Posts
    798
    To completely clear up the memory that was allocated for the instance of the class

  3. #3
    Registered User raimo's Avatar
    Join Date
    Jun 2002
    Posts
    107
    If you use only auto variables(default) then destructor is not needed. Default constructor is created anyway. But dynamically allocated data should be destroyed.

  4. #4
    x4000 Ruski's Avatar
    Join Date
    Jun 2002
    Location
    Outer Space!
    Posts
    542
    Thanks
    what does signature stand for?

  5. #5
    Registered User
    Join Date
    Jun 2002
    Posts
    106
    deconstuructors are called when a onject is destroyed
    C++ Makes you Feel Better

    "Gravity connot be held reponsible for people falling in love"--Albert Einstein

  6. #6
    x4000 Ruski's Avatar
    Join Date
    Jun 2002
    Location
    Outer Space!
    Posts
    542
    Got it
    what does signature stand for?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Can a class have multiple destructors?
    By meili100 in forum C++ Programming
    Replies: 1
    Last Post: 05-14-2008, 05:28 PM
  2. Destructors in STL?
    By sawer in forum C++ Programming
    Replies: 4
    Last Post: 08-09-2006, 09:35 AM
  3. I always have memory errors in destructors
    By rmullen3 in forum C++ Programming
    Replies: 2
    Last Post: 01-03-2004, 03:07 PM
  4. Destructors in dynamically allocated arrays
    By frenchfry164 in forum C++ Programming
    Replies: 1
    Last Post: 11-28-2003, 11:26 PM
  5. Virtual & Pure virtual destructors
    By BMJ in forum C++ Programming
    Replies: 61
    Last Post: 08-22-2002, 09:38 AM