Please use [
code] tags.
Remember, there are two parts to a merge sort.
(1) divide -- split your data into two parts and recurse over them
(2) merge -- join the two parts
Your naming has confused you a little. In order to do it, you have named the main mergesort "msort" and the merge part "mergesort".
It might help you to rename "mergesort" to "merge" and then "msort" to "mergesort".
In the merge part, your first loop is correct -- you copy a[] to aux[]. After that you mess up.
Remember that you are merging aux[lo..mid-1] with aux[mid..hi], placing the results in a[k++], where k starts at lo.
You might want to take a look at the FAQ to read about the merge algorithm:
http://www.cplusplus.com/faq/sequences/sequencing/sort-algorithms/mergesort/#algorithm
Specifically, given (lo, mid, hi), you also need to have
k --> index into a[] where next element goes
m --> index into aux[] from lo to mid-1
n --> index into aux[] from mid to hi-1
While m < mid and n < hi:
put smallest of aux[m],aux[n] into a[k]
increment k, and whichever of m,n is correct
Copy any remaining elements of aux[m..mid-1] or aux[n..hi-1] to a[k..hi-1].
Hope this helps.