Unlike Java in C, the statement is often separated from the definition of functions. It is common for the definition to go into a .c
file and the statement is in a file called the .h
header. But this is not required.
Contrary to what many people believe the prototype (function declaration) is required only when it will use in external file - the intention here - or when there are cyclical references between functions. The way the question is used is totally useless if you change the order of the functions.
When using functions from another file, the common thing is to use the #include
of this .h
to include the definitions and the compiler knows how to handle that.
All codes, usually .c
, need to be compiled. This is done manually. They also need to be linked together somehow, either during compilation or later, when they already have something precompiled.
The question does not give enough information to give a more detailed answer, but it would be basically what it already did with language components:
#include <seuOutroArquivo.h>
Of course, you do not always have to do this. It depends on the context, on the concrete case you are making. To decide the right way you have to learn the whole, understand the philosophy of language.
In this file it would have something like this (I'll kick it since the question does not help):
int algumaRegraDeNegocio(int);
And there in a file .c
would have something like this:
int algumaRegraDeNegocio(int valor) {
//faz alguma coisa aqui
return 1;
}
Obviously this is a huge simplification.
To better understand header operation.
See: What's the difference between declaration and definition?
Note that there is a very large gap between Java and C. If you try to play in C what you did in Java it will go very wrong. I say this because it seems that you are trying to use the philosophy of one in the other.