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

main() { intj; while9j<=10) { printf("\n%d",j); j=j+1; } }

4 Answers  


#&#8206;include&#8236;<stdio.h> void main() { int i; for(i=5;0;i++) { printf("%d",i); } }

2 Answers   Facebook,


What is operator precedence?

0 Answers  


Once I have used freopen, how can I get the original stdout (or stdin) back?

0 Answers  


What are structural members?

0 Answers  






What is the Difference between Class and Struct?

10 Answers   Motorola,


Write the program with at least two functions to solve the following problem. The members of the board of a small university are considering voting for a pay increase for their 10 faculty members. They are considering a pay increase of 8%. Write a program that will prompt for and accept the current salary for each of the faculty members, then calculate and display their individual pay increases. At the end of the program, print the total faculty payroll before and after the pay increase, and the total pay increase involved.

0 Answers   Convergys,


What are the uses of a pointer?

0 Answers  


Why is c not oop?

0 Answers  


the maximum width of a c variable name can be a) 6 characters b) 8 characters c) 10 characters d) 20 characters

2 Answers  


Program to write some contents into a file using file operations with proper error messages.

2 Answers  


Difference between malloc() and calloc() function?

0 Answers  


Categories