What is the difference between macros and inline functions?
Answer Posted / vishal
1> Macros are always expanded by pre-processor, whereas compiler may or may not replace the inline definitions. You cant force compiler to make a function inline. It is purely compiler based decision.
2> Debugging macros is also difficult.
3> Expressions passed as arguments to inline functions are evaluated once. In some cases, expressions passed as arguments to macros can be evaluated more than once.
Here i got exact answer : http://www.firmcodes.com/difference-macro-inline-c/
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How to write c functions that modify head pointer of a linked list?
Write a Program to find whether the given number or string is palindrome.
Why #include is used in c language?
How is pointer initialized in c?
What do you understand by normalization of pointers?
Which is best book for data structures in c?
How can I open a file so that other programs can update it at the same time?
How to write a code for reverse of string without using string functions?
please send me the code for multiplying sparse matrix using c
Explain what is the benefit of using const for declaring constants?
What is a ternary operator in c?
why to assign a pointer to null sometimes??how can a pointer we declare get assigned with a garbage value by default???
Define Spanning-Tree Protocol (STP)
What is difference between class and structure?
find the output? void r(int a[],int c, int n) { if(c>n) { a[c]=a[c]+c; r(a,++c,n); r(a,++c,n); } } int main() { int i,a[5]={0}; r(a,0,5); for(i=0;i<5;i++) printf("\n %d",a[i]); getch(); }