The #define directive is used for two purposes. Both purposes discussed here involve basic substitution—in other words, the pre-processor substitutes one constant value for another whenever it is encountered in a source file. The way to use #define is to define a constant value that will be replaced by the pre-processor.
The pre-processor is capable of substituting a named value with a real value or even performing some basic expansion and evaluation tasks. The four key #define keywords most commonly used in C programming are as follows:
#define <constant_name> <coinstant_value> #ifdef <constant_name> #ifndef <constant_name> #endif
The #define statement defines a constant <constant_name> and associates it with <constant_value> ...