Some people like having their main function be the first
function in their program. On the other hand, the compiler needs to
know about a function before main can use it, and the compiler
reads in the program from top to bottom. How can we make these people
happy?
The solution is function declarations, lines which tell
the compiler that a function is going to be defined later and which
tells it everything it needs to know about the function for the time
being.
Function declarations look like the first line of the function
with an added semicolon. Here are some valid function declarations:
int power(int x, int n);
int square( int );
int factorial( int n );
As the int square( int); example shows, you don't even
have to name the function's arguments in the function declaration.
You do need, however, to specify all of the arguments' types.