Tuesday, 27 August 2013

Function declarations in a header

Function declarations in a header

If I am creating a header file containing the definition of several
functions, why is it good practice to also include function declarations
within the same header? It seems redundant to include the declarations
when the definition itself will suffice.
Furthermore I'm trying to understand what the declarations are for. It
seems like if the function isn't defined in the same file that the
declaration is in, you can't use the declaration in another file by itself
and use the function.
Is there a specific case that would serve as a good example of how it used?

No comments:

Post a Comment