Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Inline Function in C++

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 101
    Comment on it

    Inline Function:- The Inline function are those that can be expand at the time of compilation. inline function is a combination of macro & function. Either at the time of declaration or definition of function place the keyword inline before the function name. we can also declare the member function as inline. inline functions can be expand at the time of compilation so It relieves the burden involved in calling a function.

    NOTE:- The compiler can ignore the inline qualifier in case defined function is more than a line. don't put any looping statement inside that function otherwise that is not treated as inline.

    inline.cpp

    #include<iostream.h>
    #include<conio.h>
    
    inline add(int a,int b)
    {
        return (a+b);
    }
    
    void main()
    {
    clrscr();
    cout<<add(2,3);
    getch();
    }
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: