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

Are comments included during the compilation stage and placed in the EXE file as well?

0 Answers  


Explain what happens if you free a pointer twice?

0 Answers  


What is difference between class and structure?

0 Answers  


Given a piece of code int x[10]; int *ab; ab=x; To access the 6th element of the array which of the following is incorrect? (A) *(x+5) (B) x[5] (C) ab[5] (D) *(*ab+5} .

2 Answers   Oracle,


how does the C compiler interpret the following two statements p=p+x; q=q+y; a.p=p+x; q=q+y b.p=p+xq=q+y c.p=p+xq; q=q+y d.p=p+x/q=q+y

4 Answers   TCS,






What are pointers? What are stacks and queues?

0 Answers   Hexaware,


If fflush wont work, what can I use to flush input?

0 Answers  


Explain the use of #pragma exit?

0 Answers  


Convert a distance from miles to kilometers .there are 5280 feets per mile,12 inches per foot .2.54 centimeters per inch and 100000centimeters per kilometer

0 Answers   TCS,


How can I manipulate individual bits?

0 Answers  


write function to reverse char array ... without using second array

3 Answers  


write a string copy function routine?

2 Answers  


Categories