#define

A preprocessor directive that creates a macro — a named constant or parameterized code fragment substituted before compilation.

Syntax

c
#define NAME value
#define MACRO(x) expression

Example

c
#define PI 3.14159265
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define ARRAY_SIZE 100

double circumference = 2 * PI * radius;
int largest = MAX(x, y);
int arr[ARRAY_SIZE];