What is inline Function in C++

In this problem we will learn how to use the inline Function in C++. inline Function is mostly used when we working on the classes and compiler jump here and there for collection the codes . The Structure of the inline function is that the compiler make a copy of each inline function and keep them every where ,where these function calls in main class. The technique save the time in very complicated application where time (nano seconds ) matter a lot.

Source Code 


#include<iostream>
using namespace std;
inline int findmax (int  ,int  );
int main ()
{
 int x,y;
 cout<<" Enter Your Number : \n ";
 cin>>x;
 cout<<" Enter Your Number : \n ";
 cin>>y;
 cout<<" The Bigger Number is : "<<findmax(x,y);
 
}
inline int findmax (int a,int b)
{
return  ( a > b ) ? a : b; }

Output of the Program

C++ Programming

Share on Google Plus

About Asad

Asad Niazi is Software Engineer , Programmer, Web Developer and a young mentor of BloggersTown and PProgramming. Asad Love to writes about Technology, Programming, Blogging and make money online.

2 comments:

  1. Good I have didn't know about too much that functions Use Thanks

    ReplyDelete
    Replies
    1. Thanks Brother being with us Keep in touch we will uploaded as these function very Soon :)

      Delete