The C ‘#include’ Statement

The C programming language contains a vast array of functionality, known as the C Standard Library, which is split up in to what are called header files. In order to use the functionality within these files, they must first be included at the top of the program, using the ‘#include’ statement. The ‘#include’ statement is one of a number of pre-processor commands, which informs the compiler to do something prior to compilation, in this case, include the header file.

#include <header-file-name.h>

All header files have a ‘.h’ extension. Below is a list of some of the header files available, along with a brief description of the functionality that they contain.

File Name Description
assert.h Functionality to verify assumptions made by a program.
ctype.h Functionality for the testing and mapping of characters.
errno.h Functionality to help determine what went wrong in the event of an error.
float.h Functionality to handle floating-point values.
locale.h Location specific functionality to determine items such as the date format and currency symbol.
math.h Mathematical functions.
stdarg.h Functionality to handle variable arguments.
stdbool.h Functionality for handling Boolean values.
stdio.h Standard input/output functionality.
stdlib.h General utility functionality.
string.h Functionality for handling strings.
time.h Date and time functionality.