What is the Header file?

Meaning of header file in c language is the Simple programs can be kept in a single, but when program have a larger size then it impossible to put it all in just one file. Then you can kept in a header file.
- When a parts of program kept in separate file, then create a header file.
- Header file is denoted as ‘.h’ extention.
- Header files used in programs with the preprocessor directive #include.
- Header files are precompiled files.
- Contains function definition, Macro definitions.
- Including Header files is like copying it’s content to our program.
Syntax of header file in c language
#includeOR
#include”file”Example:
#includeS.r. NO. | Name | Description |
1. | conio.h | Console Input/output |
2. | assert.h | Diagnoshics Function |
3. | ctype.h | Character Handling Functions |
4. | stdio.h | Input/Output Function |
5. | stlib.h | Functions standard header file |
6. | math.h | Math header file |
7. | time.h | Time header file |
8. | asert.h | Assertion header file |
9. | locale.h | Localization header |
10. | signal.h | Signal header file |
11. | setjmp.h | Jump header file |
12. | stdarg.h | Standard argument header |
A header file is a file with extension. In this function h contains function declarations and micro declaration to be shared with between several Sources.
1. Standard header files
For example : stdio.h, string.h,time.h,math.h.
2. User defined header files
A file in which user can define it’s own function which you can use in main program.
1. Step :1 type this code.
2. Step:2 save code.
3. Step :3 write a main program.
#include<stdio.h>int x;#include”karl.h”int main(){ printf(“Program done”); return 0;}
Header file allows to write definition of function in one file and also it is able to use in another file. Because of this happen when you include standard files from the standard library functions. Header file contains definition of function.