☰ Topics


× Home Introduction Structure of program Variables and keywords Constants Data Types Operators Statements Functions Storage Classes Array Structure Pointer Union Strings Header Files

Header Files in C

header file contains different predefined functions, which are required to run the programa. All header files should be include explicitly before main() functions.

It allows programmers to separate functions of a program into reusable code or file. It contains declarations of variables, subroutines. If we want to declare identifiers in more that one source code file then we can declare such identifiers in header file. Header file has extension like '*.h' The prototype of library functions are gathered together into various categories and stored in header files.

E.g: All prototypes of standard input/output functions are stored in header file 'stdio.h' while console input/output functions are stored in 'conio.h'.

The header files can be defined or declared in two ways as

Method 1 is used to link header files in current directory as well as specified directories using specific path. The path must be upto 127 characters. This is limit of path declaration. Method 2 is used to link header files in specified directories only.

Standard Header Files:

Following are the some commonly used headr files which plays a vital role in C programming:

Assert.h

Ctype.h

Math.h

Process.h

Stdio.h

Stdlib.h

String.h

Time.h

Graphics.h

Next Topic ➤