Inlinefunction
Inlinefunction
Example
#include<iostream>
using namespace std;
int main()
{
int num,res;
float bs,ht,ar;
cout<<"Enter Number For Cube ";
cin>>num;
res=cubedata(num);
cout<<"cube of number is "<<res<<endl;
cout<<"Enter base and height ";
cin>>bs>>ht;
ar=areatri(bs,ht);
cout<<"Area Of Triangle is "<<ar<<endl;
return 0;
}
Some of the situations where inline expansion may not work are:
(1) If Inline Functions are recursive.