This is a destructor method for C++ Class

class MyClass
{
	~MyClass() {
		printf("destructor called!");
	}
}

Default Destructor

Deletes the allocated heap memory of a class. Does not remove:

  • Additional C malloc’d memory
  • Pointers to the class