Headers File in C Programming

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

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 (e.g. TC Folder).

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

C program to Hide Mouse Pointer

Program :

/* C program to hide mouse pointer
Creation Date : 04-June-2011, 11:53 AM
Author : www.technoexam.com [Technowell, Sangli]
Tested On: Turbo C++,Version 3.0 by Borland International,Inc. */

#include <graphics.h>
#include <conio.h>
#include <dos.h>

union REGS i, o;
int main(void)
	int gd = DETECT, gm;
	initgraph(&gd,&gm,"C:\\TC\\BGI"); //Check Your Path
	i.x.ax = 0;
	if(o.x.ax == 0)
		printf("\n\t Sorry! Mouse support not available !");
		i.x.ax = 1;

		printf("\n\t Press any key to hide mouse pointer...!");


		printf("\nMouse pointer is hidden! Press any key to exit...");
	return 0;

Output 1:

	Press any key to hide mouse pointer...!_

Output 2:

Mouse pointer is hidden! Press any key to exit..._
In above source code, the program hides the mouse pointer by setting i.x.ax=2. Where, i.x.ax = 1 is used to show mouse pointer and i.x.ax=2 is used to hide mouse pointer.

Leave A Comment

Your email address will not be published. Required fields are marked *