A header file is an h-extensioned file that contains C function declarations and macro definitions that can be shared by multiple source files. A header file’s primary function is to propagate declarations to code files. Header files allow us to store declarations in one place and then import them wherever they are needed.
In multi-file programs, this can save a lot of typing. Header files are simply files in which you can declare your own functions that can be used in your main program or while writing large C programs.