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 disadvantage of pointer in C
What is malloc calloc and realloc in c?
write a c programme for add of two numbers with out use of arthematic operators
how can i print "hello"
What is LINKED LIST? How can you access the last element in a linked list?
What are the applications of c language?
Sir i need notes for structure,functions,pointers in c language can you help me please
There seem to be a few missing operators ..
what is pointer?
print the table 5 in loops
what is a function prototype?
What is the Purpose of 'extern' keyword in a function declaration?