CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2006
    Posts
    94

    destructor does what?

    hi there,
    I know that a constructor is normally to initialise variable,
    however what does a destructor do?
    Can anyone explain?
    Thanks

  2. #2
    Join Date
    Sep 1999
    Location
    malaysia
    Posts
    191

    Re: destructor does what?

    It is your last chance to do something before the object is destroyed. E.g to delete from heap if your object had allocated them earlier and so forth..

    Mustafa
    ______________________________
    To err is human, it's the computer that causes blunders !!!

    DO: Dazzle me with your intelligence
    DON'T : Confuse me with your bullshit

  3. #3
    Join Date
    Sep 2006
    Location
    Sunshine State
    Posts
    517

    Re: destructor does what?

    Hi. Check this out, it'll answer your question and many follow-up questions you might have.

    http://www.parashift.com/c++-faq-lite/dtors.html



    -Andy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured