*Inline - function:- To Eliminate the cost of calls to small functions, c++ proposes a new feature called Inline Function.
An inline function is a function that is expanded inline when it is invoked.
-> That is, the compiler replaces the function call with the corresponding function code (something similar to macros in C).
-> The inline function are defined as follows:-
Inline function header
{
function body
}
//cpp program to demonstrate inline function By Amit raj purohit
http://codevidyalay.blogspot.com
#include<iostream>
using namespace std;
inline int mul(int a,int b)
{
return a*b;
}
int main()
{
cout<<mul(5,10);
return 0;
}
INPUT/OUTPUT:-
50