Mergesort compilation error

Why is it showing this error?
Compiling failed with exitcode 1, compiler output:
prog.cpp: In function ‘void mergeSort(long long int*, long long int, long long int)’:
prog.cpp:14:5: error: ‘merge’ was not declared in this scope
merge(a,s,e);
^~~~~
prog.cpp:14:5: note: suggested alternative: ‘memmem’
merge(a,s,e);
^~~~~
memmem

Shift your merge function on top of mergesort, since in mergesort, you are calling merge function which is neither defined or declared before. Rest code seems alright

1 Like