a) When will you make function inline and why?
Answers
Answered by
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
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
Computer Science,
7 months ago
English,
7 months ago
English,
1 year ago
Math,
1 year ago
Physics,
1 year ago