C Preprocessor Macro Substitution

  • In #define where an identifier is occurs, it replace with replacement text called string.
  • Replacement text can be created by using single or multiple tokens.
  • A token is a combination of keywords, operators, separators, constant and any other identifiers.


#define identifier Replacement_text

When we are working #define atleast single space should be required between #define, identifier and replacement text(value).


#define PI_PLUS_TWO (3.14 + 2)
#define Value_One 100

Powered by k2schools