3 ms·
It's including another C file, normally you'd just include a "header file" in C and compile each C file separately.
by phaer 4y ago
It's including another C file, normally you'd just include a "header file" in C and compile each C file separately.
- usrn 4y agoFor those who don't use C: header files are more or less an interface description and (usually) don't include any code. The code is added from external objects during the second "linking" step.
- agent281 4y agoOh, I see: including a header file injects forward declarations into the calling file. Each c file gets compiled separately into object code unless you directly import them like the code above is doing. In that case it essentially dumps the full text of the file into the calling file, which causes serial compilation of a single object file. Unless I'm mistaken that clears some stuff up for me. Thank you!
- phaer 4y agoThat's my understanding as well, so I think you are correct but I am no C wizard myself :)