lately, I had to learn C lang, when I reached the header file section I noticed that I have to include the header file that contains prototypes in the calling source and also in the source file where I defined those functions in the first place.
let's say that file.c is where I want to call the header prototypes myheader.h . Then I have to include the header #include "myheader.h"
in file.c , which is understandable.
but why I can't understand is that I have to include it in the prototype definition file proto_source.c too :
/**
* THE PROTYPES DEFINITION SOURCE proto_source.c
*/
#include "myheader.h" //what this include is doing here?
void foo(void)
{
....
}
What is the logic behind that?