Q:

What is the use of the inline function in C++?

0

What is the use of the inline function in C++?

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Answer:

The use of inline functions generates faster code and can sometimes generate smaller code than the equivalent function call generates for the following reasons:

  • It saves the time required to execute function calls.
  • Small inline functions, perhaps three lines or less, create less code than the equivalent function call because the compiler doesn’t generate code to handle arguments and a return value.
  • Functions generated inline are subject to code optimizations not available to normal functions because the compiler does not perform interprocedural optimizations.

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

C++ Interview Questions and Answers(2022)

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
What is the advantage and disadvantage of the inli... >>
<< What do you mean by inline function and How to imp...