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
What is typeof in c?
What is calloc malloc realloc in c?
Design a program which assigns values to the array temperature. The program should then display the array with appropriate column and row headings.
Write a program to display all the prime nos from 1 to 1000000, your code should not take time more than a minute to display all the nos.
Why is c fast?
How can I do peek and poke in c?
What are the advantages of c preprocessor?
will u please send me the placement papers to my mail???????????????????
What is c preprocessor mean?
What are the valid places to have keyword “break”?
explain how do you use macro?
Explain why can’t constant values be used to define an array’s initial size?
How can you increase the size of a statically allocated array?
Explain how can I write functions that take a variable number of arguments?
Why is c not oop?