ProAnswers.org

What is a macro in C language?

Macros in C refers to the C preprocessor . cpp runs over your source code when you compile it, and feeds its output directly to the input of the actual C compiler.

cpp processes all of the #define and #undef, etc. constructs in your program. Macros, specifically, are defined using the syntax:

The #define directive has the following syntax:

#define identifier replacement-list newline

#define identifier ( identifier-list(opt) )
replacement-list newline

The #undef directive has the following syntax:

#undef identifier newline

macro is an identifier.