Hi,
I am new here, and I am a beginner in C coding, and I hope you can help me to understand better. I am reading the book An Introduction to GCC by Brian Gough. I don't understand a part where the program "hello world" has been split in three files:
Here I post the code:
file (1) main.c:
Code:
#include "hello.h"
int main (void) {
hello ("world");
return 0
}
file (2) hello_fn.c:
Code:
#include <stdio.h>
#include "hello.h"
void hello (const char * name) {
printf ("Hello, %s\n", name);
}
file (3) hello.h:
Code:
void hello (const char * name);
I understand everything in the code, but, in what way the file hello_fn.c has been included in the program? and therefore why is it possible to use the custom function hello, even if in the source I can't see any inclusion for the file hello_fn.c?
please, can you give me any suggestions? many thanks really!!