Inline Function:-
The function that is declared with the help of keyword ‘inline’ is known as Inline Function.
It is a function that will expand inline at each point in a program where it is invoked. Also we can say that function body is inserted at the place of function calling whenever the compiler compiles the program so that compiler do not have to go at function definition again and again for each function call.
Like this overheads of compiler will reduced and execution time improves.
Whenever a function is called the following task will be performed,
- Storing the memory address of instructions that are used.
- The different type of values will be saved in registers.
- Actual arguments are pushed or inserted onto the stack.
- Arguments of called function will be popped or deleted from the stack.
Syntax,
inline <returntype> <functionname>(parameters)
{
Fuction Body
}
Program,
#include<iostream.h>
#include<conio.h>
inline int maximum(int x, int y)
{
return (x>y? x: y);
}
void main ()
{
clrscr();
int m= 11, n= 25;
int a, b;
a= maximum(16, 18);
cout<<” Maximum of 16 and 18 is:- “<<a;
b= maximum(m, n);
cout<<” \nMaximum of “<<m<<” and ”<<n<<” is:-“<<b;
}
Output:-
Maximum of 16 and 18 is:-1 8
Maximum of 11 and 25 is:- 25
You Also Can Visit For More Knowledge In C++:-
Visit Your YouTube Channel:- Think , About It
Visit Your Website :- www.atozlives.com
Thanks,
“Play With All Computer Science , Mathematics And Technology.”
super post
This is very easy and nice
this is very easy post
very nice post and easy
You have brought up a very good details , thanks for the post. Maryjane Enoch Prakash
Very informative blog article. Thanks Again. Really Great. Lynnelle Rick Cumings
Excellent way of telling, and nice paragraph to get facts about my presentation focus, which i am going to present in school. Carly Oswald Starbuck
I want looking through and I conceive this website got some truly useful stuff on it!. Celie Roland Kerr
Great article! That is the kind of info that are meant to be shared around the web. Moyra Dore Eisler
Nice respond in return of this question with firm arguments and describing all concerning that. Catlaina Myron Faletti
Asking questions are truly fastidious thing if you are not understanding anything entirely, however this post offers good understanding even. Gertrud Patsy Anastas Madella Dew Grae
Thanks for your handy post. As time passes, I have come to understand that the actual symptoms of mesothelioma are caused by the particular build up of fluid regarding the lining of your lung and the chest muscles cavity. The sickness may start in the chest area and pass on to other limbs. Other symptoms of pleural mesothelioma cancer include fat loss, severe inhaling and exhaling trouble, temperature, difficulty swallowing, and swelling of the neck and face areas. It really should be noted that some people having the disease tend not to experience almost any serious signs or symptoms at all. Friederike Mandel Almena
I believe this is one of the so much significant information for me. And i am happy reading your article. But want to observation on few general things, The website style is great, the articles is truly nice : D. Good job, cheers Nan Scarface Pollie
Thanks for sharing, this is a fantastic article. Much thanks again. Keep writing. Kristen Franky Lyudmila
Hi there. I discovered your web site by means of Google at the same time as searching for a similar subject, your website got here up. It appears good. I have bookmarked it in my google bookmarks to visit then. Perrine Meredith Triley
Like!! Really appreciate you sharing this blog post. Really thank you! Keep writing. Mignonne Robinet Calvinna
Somebody essentially help to make seriously posts I would state. This is the very first time I frequented your website page and thus far? I surprised with the research you made to make this particular publish incredible. Excellent job! Nola Cross Ahl
Whenever I start to read some content page I have a feeling that it is time consuming and nothing will bring me. But what about you so I was very pleasantly surprised. You are super having very valuable content and posobite very trustworthy. Keep your reputation for the future. Good luck and have a nice day. Thank you for supplying these details. This article provided by you is very useful stuff. Cool, what a website it is! Toma Lenard Flight
Porque no me llega el correo en donde me avisa en que afore estoy. Vernice Jere Silin
Thanks for sharing, this is a fantastic article post. Much thanks again. Much obliged. Kanya Elwood Rhyner
Hello there, I do believe your site could be having web browser compatibility issues. When I take a look at your website in Safari, it looks fine but when opening in IE, it has some overlapping issues. I just wanted to provide you with a quick heads up! Besides that, fantastic blog! Eleonora Kahaleel Marquita
Your article helped me a lot, is there any more related content? Thanks!