As far as I know, they are used for different purposes (.c and .h).
Here, I've found this over the internet (about libraries and headers):
Originally Posted By: What's the difference between a header file and a library?
Think of both like this (Disclaimer: this is a really high-level analogy wink ..

The header is a phone number you can call, while...
...the library is the actual person you can reach there!
It's the fundamental difference between "interface" and "implementation"; the interface (header) tells you how to call some functionality (without knowing how it works), while the implementation (library) is the actual functionality.


As far as I know, header file could help you to avoid 'undeclared function' issues, if you use function which is placed under the one that calls it, f.e.:
Code:
void callFunction(){
    makeBeep();
}

void makeBeep(){
    beep();
}

You can declare that 'makeBeep()' in the header file, so the whole .c file will 'know' the list of available functions (variables etc).

I might be wrong, but this is how I see it so far.

Best regards


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung