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
Should I learn data structures in c or python?
What is the use of getchar functions?
Explain bitwise shift operators?
c programs are converted into machine language with the help of a) an interpreter b) a compiler c) an operatinf system d) none of the above
What is an auto keyword in c?
What are the rules for the identifier?
Is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?
in linking some of os executables are linking name some of them
What is the difference between ++a and a++?
What is the difference between procedural and declarative language?
How many levels deep can include files be nested?
Why double pointer is used in c?
What is merge sort in c?
Explain the use of 'auto' keyword in c programming?
What is the difference between c &c++?