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
find the net id and host id of the following IPV4 117.34.3.8 and 132.57.8.6
when air is supplied from larger diameter pipe with some pressure if change diameter to small pipe the pressure increases or not? also what is increased pressureor velocity?
reduce the number of key strokes to execute this command : t char -t -v -f/dev/fd0
WAP in Java to print the format A B A B C D E D E
Explain a situation in which you handled a customer?s questions or problems?
Explain different parts of an instruction. What does the addressing mode bit specifies?
WHAT HAPPEN WHEN ANY SPINDLE RUN OVER 10 MM HEIGHT ABOVE BOLSTAR IN RING SPINNING FRAME
What is the most important thing to know about marine engineering?
Tell me about your parents?? Pls share any one best words...
Why the secondary ip address of interface is not advertising in IGP cloud?
What would be the difficulties with building a bridge that connects the UK and Canada?
what are the various technique used for inter process communication?
what is the difference between public static void main (String args[]) and static public void main(String args[]) in java?
PLEASE SEND ME NIC SCIENTIFIC OFFICER-2009 EXAM PATTERN AND QUESTION PAPERS
I think it is 65% in 10th, 12th n BE with a 5% relaxation in any one. For west bengal bord..what will be simple average for HS...is the additional marks would be adde with 100+200=1200.and the the average will be done. OR it will be treated 65% if somebody gets 650 in HS.? Please reply for this question......... And what is the marks criteria for infosys for experienced employee.