What is the Difference between Macro and ordinary
definition?

Answers were Sorted based on User's Feedback



What is the Difference between Macro and ordinary definition?..

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

What is the Difference between Macro and ordinary definition?..

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

What is the Difference between Macro and ordinary definition?..

Answer / himanshu goel

macro definitions can be used for conditional compilation
whereas ordinary cannot

Is This Answer Correct ?    8 Yes 13 No

Post New Answer

More C Interview Questions

Which operators cannot be overloaded a) Sizeof b) .* c) :: d) all of the above

0 Answers  


What will be the result of the following C language program? main() { int a = 0; int b = 20; char x = 1; char y = 10; if(a,b,x,y) printf("Welcome"); }

1 Answers  


int main() { unsigned char a = 0; do { printf("%d=%c\n",a,a); a++; }while(a!=0); return 0; } can anyone please explain me output????

1 Answers  


main() { int i=5; printf("%d",++i + i); } output is 10 ------------------------ main() { int i=5; printf("%d",i++ + i); }output is 12 why it is so? give appropiate reason....

2 Answers  


Is it possible to run using programming C for Java Application?

2 Answers   NIC,






how do you execute a c program in unix.

0 Answers  


hi send me sample aptitude papers of cts?

0 Answers  


What is the difference between class and object in c?

0 Answers  


How can I access an I o board directly?

0 Answers  


#include<stdio.h> #include<conio.h> void main() { float a; clrscr(); a=0.5; if(a==0.5) printf("yes"); else printf("no"); getch(); }

9 Answers   TCS,


Why structure is used in c?

0 Answers  


write a program whose output will be- 1 12 123 1234

10 Answers  


Categories