+ 1
What is the purpose of function prototypes in C?
Are they required? What purpose do they serve?
1 ответ
+ 3
Real program consists of multiple files. You need to write function prototype in one file to be able call function from another one. Usually all function prototypes are placed in header files which then included if required.
There is other interesting case with recursion. If we have a first function that calls second one while the second function calls the first then we are unable to write such construction without function prototype.