What is the Difference between Macro and ordinary
definition?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

4. main() { int c=- -2; printf("c=%d",c); }

1373


What does c mean in standard form?

606


What is exit() function?

568


What does. int *x[](); means ?

640


Write a c program to build a heap method using Pointer to function and pointer to structure ?

4183






write a C program: To search a file any word which starts with ?a?. If the word following this ?a? starts with a vowel.Then replace this ?a? with ?a? with ?an?. redirect with the output onto an output file.The source file and destination file are specified by the user int the command line.

2459


What is the size of enum in c?

628


How can you return multiple values from a function?

640


write a program which the o/p should b in such a way that s triangle if I/p is 3,a Square/rectangle if I/P=4,a pentagon if I/P=5 and so on...forget about the I/P which is less than 3

1648


a function gets called when the function name is followed by a a) semicolon (;) b) period(.) c) ! d) none of the above

883


What is advantage of pointer in c?

705


What are the 3 types of structures?

578


How can I do peek and poke in c?

626


What is else if ladder?

616


main() { int i = 10; printf(" %d %d %d ", ++i, i++, ++i); }

642