Scope of macro definition
Scope of macro definition:-
Preprocessor symbols most definitely have a scope, but that scope does not interact with the other scopes such as file scope. Preprocessor symbol scope is confined to a single translation unit.
A macro is a fragment of code which has been given a name. Whenever the name is used, it is replaced by the contents of the macro. Object-like macros resemble data objects when used, function-like macros resemble function calls. We may define any valid identifier as a macro, even if it is a C keyword.
Macroscan be used to make tasks less repetitive by representing a complicated sequence of keystrokes, mouse movements, commands, or other types of input. In computer programming, macros are a tool which allows a developer to re-use code.