title: That is abstract but has non virtual destructor The delete is causing an error. Why is that?
body: <pre><code>using namespace std;
  
  class Animal{
  public:
   virtual void cry() = 0;
   void eat();
  };
  
  
  class Cat:public Animal
  {
  public:
          virtual void cry();
          void grooming();
  };
  
  
  class Dog:public Animal
  {
  public:
          virtual void cry();
          void lash();
  };
  
  
  main()
  {
      Animal* animal = new Cat();
      animal-&gt;eat();
      animal-&gt;cry();
  
      Cat* cat = (Cat*)animal;
      cat-&gt;grooming();
  
      Dog* dog = new Dog();
      dog-&gt;cry();
      dog-&gt;eat();
      dog-&gt;lash();
  
      delete animal;     //Delete called on'animal' that is abstract but has non-virtual destruct
      delete cat;             //Thread 1: signal SIGABRT
      delete dog;
  }
  </code></pre>
  <p>The delete is causing an error. Why is that?
  Attempt to release memory via delete without using destructors, but an error occurs
  &quot;Delete called on'animal' that is abstract but has non-virtual destruct
  Thread 1: signal SIGABRT&quot;</p>