what are macros?what are its advantages and disadvantages in
c language?
Answer Posted / deepedra kushwaha
A macro is a name given to a block of C statements as a
pre-processor directive. Being a pre-processor, the block of
code is communicated to the compiler before entering into
the actual coding (main () function). A macro is defined
with the preprocessor directive, #define.
The advantage of using macro is the execution speed of the
program fragment. When the actual code snippet is to be
used, it can be substituted by the name of the macro. The
same block of statements, on the other hand, need to be
repeatedly hard coded as and when required.
The disadvantage of the macro is the size of the program.
The reason is, the pre-processor will replace all the macros
in the program by its real definition prior to the
compilation process of the program.
Describe the advantages of using macro.
A macro is a name given to a block of the code which can be
substituted where the code snippet is to be used for more
than once.
- The speed of the execution of the program is the major
advantage of using a macro.
- It saves a lot of time that is spent by the compiler for
invoking / calling the functions.
- It reduces the length of the program.
| Is This Answer Correct ? | 16 Yes | 11 No |
Post New Answer View All Answers
What is your Job Profile in IT feild.
write program which accept information about 5 student & display same information according to ascending order of their name??
can u perform addition of two octal numbers using java?
DVC2000 performent: travel ??? and not output signal
how to increase the chiller effiency?
C++ PROGRAM FOR FIBONACCI SERIES USING COPY CONSTRUCTER
Please. Does someone know how to inicialize tapes in ATL? I need have 100 tapes to init inside the ATL, how is the process to complete this request?
Do you have any tips for using 3G phones?
Hi All... PLease send me if anyone have "Information Security Officer" Aptitude papers. Please Mail me at mannusanghi@gmail.com
How to score well in examination of MCA(engg) december 2012? please reply soon........
Please explain me gsm call scenario for a prepaid roamer calling to a prepaid roamer?
hi,i came to US to pursue my masters in computer information technology.Can i do my masters the first 6months in US and the rest 9 months course from INDIA through online education
why view is created in database
Sir, I was recently placed at ITC Infotect. My ctc is 2.46lpa. How much will I get in hand every month? Plssss answer. Thanx in advance.
why not overloading -,=,_,\ operator