Generally speaking, you don't need to explicitly declare functions because defining them also declares them. Here are two situations where you would need to:
The definition of the function is in an external module.
For example, if the function is defined in
definer.c
, but you want to call it fromuser.c
, you will need to declare the function inuser.c
or a file included by it (typically,definer.h
).The definition of the function comes after a call to it.
For example, if you have two functions that call each other, you will need to declare the second one before the definition of the first one.