Computer Science, asked by ritikajakhotiya9496, 1 year ago

a) When will you make function inline and why?

Answers

Answered by arpit281
36
The inline functions are a C++ enhancement feature to increase the execution time of a program.Functions can be instructed to compiler to make them inline so that compiler can replace those functiondefinition wherever those are being called. Inline function is a functionthat is expanded in line when it is called.
Answered by Anonymous
33

We will make a function inline when the functions are small that called often. Inline functions run a little  faster than the normal functions as the compiler replaces the function call statement with the function code  itself and then compiles the entire code. Thus, with inline functions, the compiler does not have to jump to  another location to execute the function, and then jump back as the code of the called function is already  available to the calling program.

Similar questions