Why is the function prototype inside a different function block?

前端 未结 3 1090
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-11 19:27

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         


        
3条回答
  •  庸人自扰
    2021-01-11 19:56

    The prototype should be added before the actual function is used for first time. In this case, I do not think its a general practice to have prototype in qsort() function, however, it still serves the purpose. The prototype for swap() could also be added before main() too, don't think it will make a difference.

提交回复
热议问题