title: How Does Virtual Destructor work in C++
body: <p>I will  type an example :</p>
  
  <pre><code>class A
  {
  public:
  virtual ~A(){}
  };
  
  class B: public A
  {
  public:
  ~B()
  {
  }
  
  };
  
  
  
  int main(void)
  {
  A * a =  new B;
  delete a;
  return 0;
  }
  </code></pre>
  
  <p>Now in Above Example , destructors  will be called recursively bottom to up .
  My Question is how Compiler do this MAGIC .</p>