I'm a beginner in C. I checked the various discussion for the query I was looking for, but none of them helped. I wrote a code for Merge Sort and I'm getting the following errors:
expected expression before 'int'
too few arguments to function 'MergeSort'
int *list; //pointer to array of integers int * MergeSort(int *A, int x, int y); //function definition, the function returns a pointer to an array of integers. int * MergeSort(int *A, int x, int y) //function declaration { //some code int size=1+y-x; int half=size/2; MergeSort(int *A, 0, half-1); //error in this line MergeSort(int *A, half, y); //error in this line //some code }
Help would be greatly appreciated! Thank you.
Update: Previous error resolved.
Segmentation fault (core dumped). I don't understand the problem. Here's a link to the code I've written. http://ideone.com/mHXQ66