Published on: 12th Nov 2010    |   Last Updated on: 24th Nov 2011

Header File in C :

Header file contains different predefined functions, which are required to run the program. All header files should be included explicitly before main ( ) function.

It allows programmers to seperate functions of a program into reusable code or file. It contains declarations of variables, subroutines. If we want to declare identifiers in more than one source code file then we can declare such identifiers in header file. Header file has extension like '*.h'. The prototypes 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 : #include "header_file-name"
Method 2 : #include <header_file-name>

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 :

Followings are the some commonly used header 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


Link this post on your Blog/Website :

Follow us on :   Technoexam on facebook Technoexam on twitter Technoexam on linkedin Technoexam on youtube