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 nested structure in c?
What are the applications of c language?
Why c is called top down?
main use of recursive function a) processing speed high b) reduce program length/reduce repeated statements c) if you do not, use iterative methods like, for, while or do-while d) all the above
How to establish connection with oracle database software from c language?
What is the best style for code layout in c?
What are the key features in c programming language?
What is a substring in c?
Explain zero based addressing.
What are the complete rules for header file searching?
in programming languages a statement or part of a statement that specifies several different execution sequences a) constructs b) distructs c) executes d) none
Create a simple code fragment that will swap the values of two variables num1 and num2.
What is c token?
Can you pass an entire structure to functions?
What is local and global variable in c?