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 pragma in c?
What's a "sequence point"?
will u give me old quesrion papers for aptitude for L & t info tech?
What is the easiest sorting method to use?
What is the difference between break and continue?
How many types of linked lists what are they? How many types of data structures?
18 Answers BSNL, Pivotal Software,
Explain how do you determine whether to use a stream function or a low-level function?
What is the use of getchar functions?
Write a program for finding factorial of a number.
without a terminator how can we print a message in a printf () function.
Are comments included during the compilation stage and placed in the EXE file as well?
What is the output of the program given below #include<stdio.h> main() { char i=0; for(;i>=0;i++) ; printf("%d\n",i); }
21 Answers ADITI, Student, TCS,