C
Programming and Technical
What are macros? what are its advantages and
disadvantages?
Read Solution (Total 2)
-
- macro:-simplified function of c is known as macro.
example
int sum(int a, int b)
{
int sum=0;
sum=a+b;
return sum;
}
this function can be replaced by the macro
#define sum(a,b) a+b;
advantage
macros occupies less memory
access time is less in compare to function
disadvantage
there is not any compilation error is generated by the compiler - 10 years agoHelpfull: Yes(2) No(0)
- Macros are like abrevations used during compilation time
- 11 years agoHelpfull: Yes(0) No(0)
C Other Question