What do you mean by inline function?

Showing Answers 1 - 1 of 1 Answers

samiksc

  • Jan 24th, 2006
 

Inline keyword is a request to the compiler to replace the calls to the function with the actual code of the function. The intention is to skip all stack operations required for a function call. (When a function calls another function, the called function with all its state is pushed on the system stack and later when it finishes execution it is popped up from stack to allow the calling function to continue.) All this process is not necessary, in fact works as a overhead for small functions, and slows them down.

If these are made inline by the compiler you get an advantage of having to modify it (if required) in only one place, while the overheads associated with function call are avoided.

You never know whether a function is really executed as inline by the compiler. The compiler does not generate any warning or info message regarding this.

Recursive functions cannot be made inline.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions