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 |
main() { intj; while9j<=10) { printf("\n%d",j); j=j+1; } }
#‎include‬<stdio.h> void main() { int i; for(i=5;0;i++) { printf("%d",i); } }
What is operator precedence?
Once I have used freopen, how can I get the original stdout (or stdin) back?
What are structural members?
What is the Difference between Class and Struct?
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.
What are the uses of a pointer?
Why is c not oop?
the maximum width of a c variable name can be a) 6 characters b) 8 characters c) 10 characters d) 20 characters
Program to write some contents into a file using file operations with proper error messages.
Difference between malloc() and calloc() function?