A preprocessor include directive causes the preprocessor to replace the directive with the contents of the specified file.
#include "payroll.h"
it
is treated as a user-defined file, and may represent a header or source
file. #include <stdio.h>
it is
treated as a system-defined file, and must represent a header file.The new-line and > characters cannot appear in a file name delimited by < and >. The new-line and " (double quotation marks) characters cannot appear in a file name delimited by " and ", although > can.
The file_path can be an absolute or relative path. If the double quotation marks are used, and file_path is a relative path, or is not specified, the preprocessor adds the directory of the including file to the list of paths to be searched for the included file. If the double angle brackets are used, and file_path is a relative path, or is not specified, the preprocessor does not add the directory of the including file to the list of paths to be searched for the included file.
#define MONTH <july.h>
#include MONTH
/* defs.h */
#define TRUE 1
#define FALSE 0
#define BUFFERSIZE 512
#define MAX_ROW 66
#define MAX_COLUMN 80
extern int hour;
extern int min;
extern int sec;
#include "mydefs.h"
#include "defs.h"
#define C_IO_HEADER <stdio.h>
/* The following is equivalent to:
* #include <stdio.h>
*/
#include C_IO_HEADER
In C++11, the changes to header and include file names in the C99 preprocessor are adopted to provide a common preprocessor interface for C and C++ compilers. The first character of a header file name in an #include directive must not be a digit in C++11. For more information, see C99 preprocessor features adopted in C++11 (C++11).