I know that extern
is very important with variables as per this question What's the difference between using extern and #including header files? and I totally see the point and rationale of using extern
variable.
But I can't still digest the idea behind extern
function, I know how it works and linking and all of that, but wouldn't it be the same if we have the function defined in a header file?
I can only think of the benefit of using dynamic-link library so we don't have to build our application each time the library changes, but why I go out of my way and use extern
with static-link library instead of just include the header file.
UPDATE:
I know the difference between defintion and declaration.