Search
 
SCRIPT & CODE EXAMPLE
 

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;
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: delete item from linked list in c++ 
Cpp :: destiny child 
Cpp :: c++ reverse bits 
Cpp :: PCL normal specific point 
Cpp :: cpp class access array member by different name 
Cpp :: Fill 2-dimensional array with value 
Cpp :: stack algorithm in c++ 
Cpp :: estimateaffine3d example c++ 
Cpp :: how initilaize deffult value to c++ class 
Cpp :: fishes code in assignment expert 
Cpp :: dfs in tree using adjacency list 
Cpp :: assign array to array 
Cpp :: set(W) 
Cpp :: 2000pp pp play osu std 
Cpp :: std remove example 
Cpp :: huffman encoding in c++ 
Cpp :: c++ string to const char* 
Cpp :: convert string to wide string 
Cpp :: stp 
Cpp :: different way to print string in c++ 
Cpp :: 378. Kth Smallest Element in a Sorted Matrix using binary search 
Cpp :: c++ ide online 
Cpp :: inbuilt function for bin to dec in c++ 
Cpp :: how to find total numbe of distinct characters in a string in c 
Cpp :: C++ Ranged Based for Loop 
Cpp :: infix to prefix using cpp linked list program 
Cpp :: c++ negate boolean 
Cpp :: how to check code execution time in visual studio c++ 
Cpp :: amusia 
Cpp :: assignment operator 
ADD CONTENT
Topic
Content
Source link
Name
2+6 =