1.

Define Macro with suitable example.

Answer»

Macros are preprocessor directive created using # define that serve as symbolic constants. They are created to simplify and reduce the amount of repetitive coding

For instance,

#define max (a, b) a>b? a: b

Defines the macro max, taking two arguments a and b. This macro may be called like any function. Therefore, after preprocessing

A = max(x, y);

Becomes A = x>y?x :y ;



Discussion

No Comment Found

Related InterviewSolutions