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
5S training documents
Prepare the UGC CSIR net question papers those are enough. The question paper will be of 50 questions in size each 3 marks and with a negative of -1 for each wrong answer
Explain what are db_options used for?
successful command to make linux system as router in redhat-+
i have got a gre score of 800 in my first attemt and a score of 1080 in the second and i have repoted both the scores.will it effect my chances of getting good university
Hi All... PLease send me if anyone have "Information Security Officer" Aptitude papers. Please Mail me at mannusanghi@gmail.com
can any one send me the configuration of cisco 1841 router????/
i want a richdatatable to be displayed only when a list has some value in the bean, and a datatable with header only if the list is empty. And i want the datatable to be printed only when ajax button is clicked??
nohup sort employees > list 2 > error out & what will happen?
what books to prepare for atc please
what is the Relationship between quantity of Gas and capacity of AC machine in tonnage.
WAP in Java to print the format AMIT M I T
Apply Newton?s method to compute the approximate value of root 2. Start the iteration from x0=1, and obtain two iterations.
model question papers of GrayOrange company
In HSE what is Lost time accident? why it is to be reported within 48 hrs to gov.authorities ?