#include<iostream>
#include<vector>
class Container {
int * m_Data;
public:
Container() {
//Allocate an array of 20 int on heap
m_Data = new int[20];
std::cout << "Constructor: Allocation 20 int" << std::endl;
}
~Container() {
if (m_Data) {
delete[] m_Data;
m_Data = NULL;
}
std::cout << "Destructor called" << std::endl;
}
Container(const Container & obj) {
//Allocate an array of 20 int on heap
m_Data = new int[20];
//Copy the data from passed object
for (int i = 0; i < …
Run Code Online (Sandbox Code Playgroud)