adspace


What is difference between using a macro and a in line function?

Answer Posted / Vinod Mishrwan

The main differences between macros and inline functions are:
1. Syntax: Macros are defined using the preprocessor directive #define, while inline functions are declared with the keyword inline.
2. Control flow: Inline functions follow regular C function semantics and have control over their input/output parameters, whereas macros don't have such control due to their textual replacement during the preprocessing stage.
3. Code generation: The compiler has more control over the optimization of inline functions compared to macros.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Are you still writing code? Do you love it?

864


What is your experience with qa engineering?

928


What software languages have you used to design, develop, and debug software application interfaces?

944


Tell me about some of your hobby projects that you've written in your off time.

975


Would you call yourself a craftsman (craftsperson) and what does that word mean to you?

930