Function prototypes such as
void sorting();
and
void swap(int,int);
must have an identical signature to the function when it is actually declared: if it doesn't, then the two do not "match up" and the prototyped function is technically not defined at all.
Compare the prototype definitions with the actually bodied versions:
void sorting( int *array2)
{
...
}
void swap(int*a,int*b)
{
...
}
And you can see why they do not match.
In addition, C does not support "functions within functions" so you need to move the declaration of the
swap
function outside the body of the
sorting
function.