What is the Difference between Macro and ordinary
definition?
Answers were Sorted based on User's Feedback
Answer / d g patel
1. Macro takes parameters where as ordinary definition does
not.
2. Based on the parameter values to macro it can result in
different value at run time. Ordinary defination value
remains same at all place at run time.
3. Macro can be used for conditional operations where as
definition can not.
4. Using macro one can achieve inline functionality in C
ie. macro can be a function performing simple operations.
This is not possible using definitions.
| Is This Answer Correct ? | 46 Yes | 9 No |
Answer / ambar
macro is an independently executive function which executes
only when called from within the calling program . each
time it is called it takes a different parameter whearas an
ordinary defination parameters remains same till the life
of a program.
| Is This Answer Correct ? | 11 Yes | 2 No |
Answer / himanshu goel
macro definitions can be used for conditional compilation
whereas ordinary cannot
| Is This Answer Correct ? | 8 Yes | 13 No |
what is the self-referential structure?
How are Structure passing and returning implemented by the complier?
what is the return value (status code) of exit() function.... what the arguments(integer value) passed to it means....
Illustrate it summing the series 2+4+6+......to n terms using (i) while loop (ii) do-while loop
Why do we use stdio h and conio h?
How can I sort a linked list?
Write a c program using for loop in switch case?
consider the following structure: struct num nam{ int no; char name[25]; }; struct num nam n1[]={{12,"Fred"},{15,"Martin"},{8,"Peter"},{11,Nicholas"}}; ..... ..... printf("%d%d",n1[2],no,(*(n1 + 2),no) + 1); What does the above statement print? a.8,9 b.9,9 c.8,8 d.8,unpredictable value
What are local static variables? How can you use them?
What is the difference between procedural and functional programming?
What is the difference between functions getch() and getche()?
What are multidimensional arrays?