0

Possible Duplicate:
C++: Delete this?

What does it mean to delete this pointer from a member function?

According to my understanding: new returns this pointer, which we pass to delete, which in turn calls the destructor before freeing memory. So delete this should do the same thing.

My doubt is whether the destructor will be called or not?

Community
  • 1
  • 1
rakesh
  • 1,941
  • 2
  • 16
  • 23

1 Answers1

0

The destructor will be called.

rob mayoff
  • 375,296
  • 67
  • 796
  • 848