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