wiz-icon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

Scope of macro definition

A
cannot be beyond the file in which it is defined
No worries! We‘ve got your back. Try BYJU‘S free classes today!
B
may be part of a file
No worries! We‘ve got your back. Try BYJU‘S free classes today!
C
is in the entire program
No worries! We‘ve got your back. Try BYJU‘S free classes today!
D
a, b, c
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
Open in App
Solution

The correct option is D a, b, c

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.



flag
Suggest Corrections
thumbs-up
0
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Types of Analysis
GEOGRAPHY
Watch in App
Join BYJU'S Learning Program
CrossIcon