Example C++ class Foo { // This is the prototype of the destructor ~Foo(); } Foo::~Foo() { // This is the implementation of the destructor } int main() { Foo* foo = new Foo; // This is where the destructor is being called delete Foo; return 0; } Also see Constructor (antonym).
C++ class Foo { // This is the prototype of the destructor ~Foo(); } Foo::~Foo() { // This is the implementation of the destructor } int main() { Foo* foo = new Foo; // This is where the destructor is being called delete Foo; return 0; } Also see Constructor (antonym).
class Foo { // This is the prototype of the destructor ~Foo(); } Foo::~Foo() { // This is the implementation of the destructor } int main() { Foo* foo = new Foo; // This is where the destructor is being called delete Foo; return 0; }
// This is the prototype of the destructor ~Foo();
Foo::~Foo() {
// This is the implementation of the destructor
int main() {
Foo* foo = new Foo; // This is where the destructor is being called delete Foo; return 0;
// This is where the destructor is being called delete Foo;
return 0;
Also see Constructor (antonym).
Constructor (antonym).