Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

CPPDEVELOPER

#include <iostream>

class Other {
public:
  ~Other() {
    std::cout << "Other Destroyed" << std::endl;
  }
};

class Base {
public:
  ~Base(){}
};

class Derived : public Base {
private:
  Other o;
public:
  ~Derived(){}
};

int main() {
  Base *b = new Derived();
  delete b;
}
Source by assessments.reliscore.com #
 
PREVIOUS NEXT
Tagged: #CPPDEVELOPER
ADD COMMENT
Topic
Name
6+7 =