C++ Inline function

tutorial and example
tutorial and example

An inline function is a function that is elaborated in line when it is invoked. When an inline function is called, all the code of inline function gets inserted at the point of function call. It increases the execution time of program. This function uses inline keyword before the function name.

Syntax

C++ inline Example1

Output:

C++ inline Example2

It is good experience to write C++ program using class. The functions which are declared inside class are implicitly inline function. An explicit inline function is declared inside the class and defined at outside the class.

Output: