A macro is a segment of a code which is replaced by the value of macro. In C preprocessor is a micro preprocessor and that transforms your program before it is compiled. These transformations can be inclusion of header file, macro expansions etc.
Macro is defined by #define directive. There are two types of macros :
Object-like macros:The object-like macros is a identifier that is replaced by value.It is used to represent numeric constants. For Example :
#define PI 3.14
Function-like macros: The function-like macros looks like function call. For Example
#define MIN(a,b) ((a)<(b)?(a):(b))
C defines many predefined macros that can be used in C program.
represent current date in "MMM DD YYYY" format.
represent current time in "HH:MM:SS" format.
represent current file name.
represent current line number.
It is define 1 when complie with the ANSI standard.