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 the most efficient way to count the number of bits which are set in an integer?
What are the types of type qualifiers in c?
If null and 0 are equivalent as null pointer constants, which should I use?
Explain with the aid of an example why arrays of structures don’t provide an efficient representation when it comes to adding and deleting records internal to the array.
What is array of pointers to string?
What is array of structure in c?
What are file streams?
to print the salary of an employee according to follwing calculation: Allowances:HRA-20% of BASIC,DA-45% of BASIC,TA-10%. Deductions:EPF-8% of BASIC,LIC-Rs.200/-Prof.Tax:Rs.200/- create c language program?
printf(), scanf() these are a) library functions b) userdefined functions c) system functions d) they are not functions
What is the difference between printf and scanf in c?
Is c is a procedural language?
Is there a way to compare two structure variables?
How can I call system when parameters (filenames, etc.) Of the executed command arent known until run time?
What are the advantages of external class?
What is floating point constants?