A header file is a file with extension .h which contains C function declarations and macro definitions and to be shared between many several source files. There are two kinds of header files: the files that the programmer writes and the files that come with your compiler.
You request the use of a header file in your program by including it, with the C preprocessing directive #include like you must have seen inclusion of stdio.h header file as wll which comes along with the compiler.
Including a header file is equivalent to copying of the content of the header file but we do not do it because it will be very much error-prone and it is not a good idea to copy the content of header file into the source files, especially if there are multiple source file comprising our program.
In a simple practice program in C language, the place where we keep all the macros, constants, system wide global variables and function prototypes in the header files and include that header file wherever it is required.
Both user and system header files are included using the preprocessing directive #include. It has following two forms:
This form of header is used in system header files. In this, it searches for a file named "abc" in a standard list of system directories. You can prepend directories to this list with the -I option while compiling your source code.
This form of header file is used in your own programs .In this header, it searches for a file named abc in the directory containing the current file. You can also prepend directories to this list with the -I option while compiling your source code.