Q:

Can someone please explain this C++ output

I have this c++ code and the output from the code. Can someone please tell me how this code is being iterated. I tried to dry run the flow but not able to figure out. 
#include <iostream>

using namespace std;

class Something
{
public:
    Something(){cout<<"A\n";}
    virtual ~Something(){cout<<"B\n";}
};
class Parent
{
public:
    Parent(){cout<<"C\n";}
    virtual ~Parent(){cout<<"D\n";}
};
class Child : public Parent
{
public:
    Child(){cout<<"E\n";}
    Child(const Child& P){cout<<"F\n";}
    Child& operator=(const Child& rhs){cout<<"G\n";}
    virtual ~Child(){cout<<"H\n";}
protected:
    Something S_;
};
int main()
{
   Child ChildA;
   Child ChildB=ChildA;
   ChildA=ChildB;

   return 0;
}

Out:
C
A
E
C
A
F
G
H
B
D
H
B
D

A:

So you have a inheritance and composition:  child is a parent, and has a something.
Anyways, here's the use cases:
Child ChildA;

To make a child, you have to make a parent and a something.  There for you get:

C A E

To make the second item, you're going to copy from ChildA, but you start out the same:  make a parent, make a something, then copy a child:

C A F

Copy a value:

G

Then destroy each from top down:

H B D H B D

