Member • Mar 10, 2014
-
sagar salecan any one tell the ans of above question.
-
Administrator • Mar 10, 2014
@#-Link-Snipped-# What do you mean by a real life example?Are you sure? This action cannot be undone. -
Member • Mar 10, 2014
it means that actually where we can use inline function in real timeAre you sure? This action cannot be undone. -
Administrator • Mar 10, 2014
Whenever Inline Functions are called, the compiler inserts the complete body of the function in every place that the function is called.
This is different from generating code to call the function in the one place it is defined.
I assume that you're asking the advantages of using Inline Functions.
If you are developing really small and simple programs, use of inline functions is great, because it reduces the overhead of -
1. calling function
2. variables push and pop on stack (that happens during call to functions)
3. return call from functionAre you sure? This action cannot be undone. -
Member • Mar 10, 2014
@#-Link-Snipped-#, what programming language are you familiar with?Are you sure? This action cannot be undone. -
Member • Mar 12, 2014
yes sir,I am familier with c++.Are you sure? This action cannot be undone. -
Member • Mar 12, 2014
Inlining won't make much sense unless you understand a little bit about assembly or machine language. A function call involves overhead as the CPU has to keep track of current instruction pointer, then allocate stack space for the function call, execute the same and finally, restore the instruction pointer. With inlining, the code is in sequence and hence this overhead is not required.Are you sure? This action cannot be undone. -
Member • Mar 23, 2014
Thank you sir.Are you sure? This action cannot be undone.