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
Does c have an equivalent to pascals with statement?
What is the use of getchar functions?
Can we initialize extern variable in c?
How can I find out the size of a file, prior to reading it in?
Why c language is called c?
Apart from dennis ritchie who the other person who contributed in design of c language.
Explain what is the most efficient way to store flag values?
What should malloc() do? Return a null pointer or a pointer to 0 bytes?
What is a function simple definition?
What does the c in ctime mean?
What does emoji p mean?
There is a practice in coding to keep some code blocks in comment symbols than delete it when debugging. How this affect when debugging?
Why we use void main in c?
An instruction which is analysed and acted upon by the processor prior to the compiler going its work a) directive b) constructive c) constant d) absolute mode
What is meant by operator precedence?