title: invalid new-expression of abstract class type error
body: <p><strong>Homework</strong> <br/>
  I'm getting this type of error for my Merge Sort function. I think the error has something to do with my <code>merge()</code> method, but I thought I took care of it by using it in <code>MergeSort()</code>. Any help would be appreciated.<br/><br/>
  Sort.h</p>
  
  <pre><code>#ifndef SORT_H_
  #define SORT_H_
  
  class Sort {
  protected:
     unsigned long num_cmps; // number of comparisons performed in sort function
  public:
     virtual void sort(int A[], int size)= 0;    // main entry point
     bool testIfSorted(int A[], int size);        // returns false if not sorted
                                              // true otherwise
     unsigned long getNumCmps() { return num_cmps; }        // returns # of comparisons
     void resetNumCmps() { num_cmps = 0; }
  };
  
  class MergeSort:public Sort {       // MergeSort class
  public:
    void sort(int A[], int size, int low, int high);      // main entry point
  };
  
  #endif
  </code></pre>
  
  <p><br/>
  Sort.cpp <br/></p>
  
  <pre><code> Sort* s;
     switch(op.getAlg()) 
        {
        case 'S':
           s=new SelectionSort();
           break;
        case 'I':
           s=new InsertionSort();
           break;
        case 'B':
           s=new BubbleSort();
           break;
        case 'H':
           s=new HeapSort();
           break;
        case 'R':
           s=new RadixSort();
           radixsortQ = true;
           break;
        case 'M':
           s=new MergeSort(); --&gt; error
           break;
        }
  </code></pre>
  
  <p><br/>
  Merge Sort.cpp
  <br/></p>
  
  <pre><code>#include &lt;iostream&gt;
  #include "Sort.h"
  using namespace std;
  void MergeSort::sort(int A[], int size, int low, int high)          // main entry point
  {
      if (low &lt; high){
          int middle = (low + high) / 2;
          MergeSort(A, size, low, middle);
          MergeSort(A, size, middle+1, high);
          merge(A, size, low, middle, high);
      }
  }
  
  void merge::sort(int A[], int size, int low, int middle, int high){
      int temp[size];
      for(int i = low; i &lt;= high; i++){
          temp[i] = A[i];
      }
      int i = low;
      int j = middle + 1;
      int k = low;
  
      while(i &lt;= middle &amp;&amp; j &lt;= high){
          if(temp[i] &lt;= temp[j]){
              A[k] = temp[i];
              ++i;
          }
          else {
              A[k] = temp[j];
              ++j;
          }
          ++k;
      }
      while(i &lt;= middle){
          A[k] = temp[i];
          ++k;
          ++i;
      }
  }
  </code></pre>