Well yes, of course there's a reason.
The reason is that with the headers, you get the proper declarations, otherwise you get the implicit declaration where every function is assumed to return int
. Since there are many functions (for instance malloc()
) that don't return int
, assuming that they do can be very harmful.
With function declarations the compiler can actually check that arguments and return values match the usage, which is very good.
Also, there are of course cases where headers declare data types, enumerations and so on that you need, there's more than functions in headers.