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

What is the difference between scanf and fscanf?

0 Answers  


What are control structures? What are the different types?

0 Answers  


what are the facialities provided by you after the selection of the student.

0 Answers   TCS,


How does C++ help with the tradeoff of safety vs. usability?

1 Answers  


What's the difference between calloc() and malloc()?

4 Answers  






Explain what are binary trees?

0 Answers  


How can I dynamically allocate arrays?

0 Answers  


what will be the result of the following program ? char *gxxx() { static char xxx[1024]; return xxx; } main() { char *g="string"; strcpy(gxxx(),g); g = gxxx(); strcpy(g,"oldstring"); printf("The string is : %s",gxxx()); } a) The string is : string b) The string is :Oldstring c) Run time error/Core dump d) Syntax error during compilation e) None of these

2 Answers   IBM,


Write a program to generate a pulse width frequency of your choise,which can be variable by using the digital port of your processor

0 Answers   TATA, TCS,


What is the use of getchar() function?

0 Answers  


c program to subtract between two numbers without using '-' sign and subtract function.

1 Answers  


what is the difference between global variable & static variable declared out side all the function in the file.

2 Answers  


Categories