Inline Functions in C++

As we know, when we call a function from the main program, the control jumps to the function and then comes back to the calling program when execution of function is completed. This process, although looks simple, but involves a lot of background processes as of passing of parameters to the function, allocating of storage for function’s local variables, storing the current variables, etc. C++ provides a convenient way of omitting all these processes by simply declaring the function to be inline. When we declare a function inline, we tell the compiler to replace each call to such function(declared inline) with the explicit code of the function. To declare a function inline all we need to do is to add the word inline before the definition of the function as: inline data-type function_name(type 1 arg 1, type 2 arg 2, …, type n arg n); Also, in the function-prototype of...