Standard Headers for C Library Functions

The standard (ANSI) C library is divided into fifteen (15) parts. Each part is represented by a header (.h) file which you include in your C programs to use the functions in that part of the library.

#include <stdio.h>

Here is a list of these fifteen header files and a description of what is in each of them.

assert.h Diagnostics. Contains only the assert macro, which enables programs to perform self-checks. If any check fails, the program terminates.
void assert(int expression);
If expression is false, assert writes a dignostic message and terminates program execution.
 
ctype.h Character handling. Provides functions for testing and converting characters.
int islower(int c);
If c is a lower-case letter, the function returns a true (1). Otherwise it returns false (0).
 
errno.h Errors. Provides macros that allow the program to detect whether an error has occurred during calls of certain library functions. errno (which may be a macro or a variable) is an lvalue of type int that is set to a positive value when an error occurs.
 
float.h Characteristics of Floating Types. Provides macros that define the range and accuracy of floating types.
#define FLT_DIG 6
Gives the number of digits of precision for a variable of type float.
 
limits.h Sizes of Integral Types. Provides macros that define the size of integer and character types.
#define INT_MAX +32767
Gives the largest value of type int.
 
locale.h Localization. Provides functions to control locale-specific aspects of the library (aspects that depend on the country or other geographic location). These include the format of numerical values (for example, the character used as the decimal point), the format of monetary values (for example, the currency symbol), the character set, and appearance of the date and time.
 
math.h Mathematics. Provides common mathematical functions, including trigonometric, hyperbolic, exponential, and logarithmic functions. Most functions in this part of the library expect parameters of type double and return values of type double.
 
setjmp.h Nonlocal Jumps. Provides the setjmp and longjmp functions. setjmp() "marks" a place in a program; longjmp() can then be used to return to that place later. These functions are useful for returning from a nested functions call when an error occurs.
int setjmp(jmp_buf env);
Saves the current environment in env and returns zero (0).
void longjmp(jmp_buf env, int val);
Restores the environment stored in env. Then causes setjmp() to return val, which should be something other than zero.
 
signal.h Signal Handling. Provides facilities for handling exceptional conditions, including interrupts and run-time errors. You can use the signal() function to designate a signal handling function to be called when the signal occurs. You can use the raise() function to send a signal.
 
stdarg.h Variable Arguments. Allows the programmer to write functions that have variable-length argument lists. Contains the type va_list and the macros va_start, va_arg, and va_end.
 
stddef.h Common Definitions. Provides definitions of frequently used types and macros. These include such common items as the definitions of NULL and size_t.
 
stdio.h Input / Output. Provides functions for text and binary input and output and for performing file operations. These include the input and output stream functions for the console, as well as files.
 
stdlib.h General Utilities. Provides functions for converting numbers to strings and vace-versa, random number generation, memory management, communication with the environment, searching and sorting, integer arithmetic and multibyte character and string operations. In other words, functions that do not fit any other category in the standard library.
 
string.h String Handling. Provides functions that perform string operations such as copying, concatenating, searching for substrings and characters in strings, and string and substring comparisons.
 
time.h Date and Time. Provides functions for manipulating the date and time. Included are functions that get current date and time, convert date and time variables, and get elapsed times.