#include
![]()
Lines that begin with the symbol # are preprocessor directives. C processes these directives prior to compilation. Preprocessor directives are not followed with a semicolon.
#include is used to tell C which library header file(s) to use when compiling the program. Each C compiler has a standard collection of library files that contain special purpose functions.
This tells C to use stdio.h, the header file for C's standard device input/output functions. This header file contains information about standard input and output functions such as scanf and printf. Because all meaningful programs perform at least one input or output operation, this line should be in every one of your C programs. (Every program we write is meaningful - consult the syllabus.)
Other library header files commonly used:
| math.h: Common mathematical functions | |
| stdlib.h: Generally useful functions |