Loading, please wait...

Header Files

Each standard library has a corresponding header containing the function prototypes for all the functions in that library and definitions of various data types and constants needed by those functions. The following table lists alphabetically some of the standard library headers that may be included in programs.

 

You can create custom headers. Programmer-defined headers should also use the .h filename extension. A programmer-defined header can be included by using the #include preprocessor directive.

 

For example, if the prototype for our square function was located in the header square.h, we’d include that header in our program by using the following directive at the top of the program:

#include "square.h"

 

Header

Description

<assert.h>

Contains macros and information for adding diagnostics that aid program debugging.

<ctype.h>

Contains function prototypes for functions that test characters for certain properties, and function prototypes for functions that can be used to convert lowercase letters to uppercase letters and vice versa.

<errno.h>

Defines macros that are useful for reporting error conditions.

<float.h>

Contains the floating-point size limits of the system.

<limits.h>

Contains the integral size limits of the system.

<locale.h>

Contains function prototypes and other information that enables a program to be modified for the current locale on which it’s running. The notion of locale enables the computer system to handle different conventions for expressing data like dates, times, dollar amounts and large numbers throughout the world.

<math.h>

Contains function prototypes for math library functions.

<setjmp.h>

Contains function prototypes for functions that allow bypassing of the usual function call and return sequence.

<signal.h>

Contains function prototypes and macros to handle various conditions that may arise during program execution.

<stdarg.h>

Defines macros for dealing with a list of arguments to a function whose number and types are unknown.

<stddef.h>

Contains common type definitions used by C for performing calculations

<stdio.h>

Contains function prototypes for the standard input/output library functions, and information used by them.

<stdlib.h>

Contains function prototypes for conversions of numbers to text and text to numbers, memory allocation, random numbers, and other utility functions.

<string.h>

Contains function prototypes for string-processing functions.

<time.h>

Contains function prototypes and types for manipulating the time and date.