program.c :
int main () {
hello();
return 0;
}
tools.c :
void hello (void) {
printf("hello world\n");
}
Makefile :
program : program.o tools.o
In the set of files of this program I have no tools.h file, even though it compiles fine with no errors, could someone explain the purpose of header files in C programs ?
For now I only have one idea : variables such as structures are required at the compilation layer...
But in my case, if the header file only contains function prototypes, is it longer required to build it ? (the makefile linker syntax is a bit easier to catch).
Header files usually would contain declarations of the functions which are defined in source c files.
What purpose does it serve?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With