// line comment
/* block
comment */
// from /usr/include or other path provided by -I/path/to/files.
#include <system_file>
// from .
#include “user_file.h”
#define IDENTIFIER \
replacement list
#define IDENTIFIER([parameter][, ...]) replacement list
#undef IDENTIFIER
Define requires ( to immediately proceed the identifier.
#if [!]constant expression
...
#elif [!]constant expression
...
#else
...
#endif
#if defined(IDENTIFIER)
#if defined IDENTIFIER
#ifdef IDENTIFIER
#ifndef IDENTIFIER
__LINE__ |
Current line number being compiled. |
|---|---|
__FILE__ |
Current name of file being compiled. |
__DATE__ |
Date of compilation. |
__TIME__ |
Time of compilation. |
#define print_int(x) printf(#x " = %d", x)
#define VAR_ID(n) var##n
int VAR_ID(1); // becomes int var1;
#error message // Compiling stops and displays message.