ADVERTISEMENT
ADVERTISEMENT

Home » C++ programs » C++ basic programs

C++ program to demonstrate example of Inline Function

In this example you will learn about inline function in c++ programming language, you will learn how to create, define and call of an online function..

Inline Function example in C++



/*C++ program to demonstrate Inline Function.*/
#include  <iostream>
using namespace std;
 
//inline keyword is only use in declaration.
inline int fun();
 
int main()
{
    fun();
    return 0;
}
 
int fun()
{
    cout << "I am from inline function " << endl;
    return 0;
}

Output

    I am from inline function
ADVERTISEMENT



ADVERTISEMENT



Comments and Discussions


ADVERTISEMENT

ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT

Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.