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 |
Which operators cannot be overloaded a) Sizeof b) .* c) :: d) all of the above
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"); }
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????
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....
Is it possible to run using programming C for Java Application?
how do you execute a c program in unix.
hi send me sample aptitude papers of cts?
What is the difference between class and object in c?
How can I access an I o board directly?
#include<stdio.h> #include<conio.h> void main() { float a; clrscr(); a=0.5; if(a==0.5) printf("yes"); else printf("no"); getch(); }
Why structure is used in c?
write a program whose output will be- 1 12 123 1234