title: Recursive Merge Sort In C++
body: <p>I'm trying to code a merge sort in c++, but building it gives me a warning that it's recursive, and running it gives a stack overflow. I don't understand where I'm doing wrong.</p>
  
  <pre><code>void mergesort(int thelist[]) {
    if (sizeof(thelist) &lt;= 1)
      return;
  
    int middle = (sizeof(thelist) / 2);
    for (i = 0; i &lt;= sizeof(thelist); i++){
      if (i &lt; middle)
        lft[i] = thelist[i];
      else if (i &gt;= middle)
        rght[i-middle] = thelist[i];
    }
    mergesort(lft);
    mergesort(rght);
    merge(lft, lft + 10, rght, rght + 10, sortedlist);
  }
  </code></pre>