I am trying to understand C, by going through K&R. I have trouble understanding this code for two functions found in the book:
void qsort(int v[], int le
You write a function prototype so that the compiler knows that function exists, and can use it. swap()
is used inside qsort()
, so it must appear before the line it is used. In this case, the swap()
prototype is declared inside the qsort()
function, but it could as well be declared before the function itself. Or you could define swap()
before qsort()
and remove the prototype.