Currently Empty: ₹0.00
Macro is a preprocessor directive that defines a piece of code that can be reused throughout your program.
Macros are defined using the #define
directive and can be used to create constants, inline functions, or even to conditionally include code.
Syntax: #define NAME value
Type : Two Type of macro
1) Object Macro.
2) Function Macro.
Object Macro:- It is widely used to represent numeric Constants.
Example: #define PI 3.14
Function-like Macros:
You can create macros that take arguments, similar to functions.
Example :#define SQUARE(x) ((x) * (x))
example: #define min((a,b) (a)<(b)?(a):(b))