Sort function isn't functioning

the sort function which works under algorithm header file is showing some error in my code.
or either it is forcing me to use qsort function which I don’t.
The same question has been solved and submitted successfully on Leetcode by me, but her I can’t.

@A17LP0071
Could you share your code by saving it on the IDE ?