This section illustrates you how to use macros in C.
Macros are the identifiers that represent statements or expressions. To associate meaningful identifiers with constants, keywords, and statements or expressions, #define directive is used. You can see in the given example, we have define a macro i.e SQUARE(x) x*x. Here the macro determines the square of the given number.
Macro Declaration: #define name text
Here is the code:
DEFINEMA.C
#include <stdio.h>
|
Output will be displayed as:
DEFINEMA.EXE
![]()
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.
Ask Questions? Discuss: C define Macro
Post your Comment