Inline Function Cpp
Inline Function Cpp
Constructors
Unit - II
2.1 Inline function
• C++ provides inline functions to reduce the function call overhead.
• An inline function is a function that is expanded in line when it is
called.
• When the inline function is called whole code of the inline function
gets inserted or substituted at the point of the inline function call.
• This substitution is performed by the C++ compiler at compile time.
• An inline function may increase efficiency if it is small.
• In C++, we can declare a function as inline.
• This copies the function to the location of the function call in compile-
time and may make the program execution faster.
Syntax: