Google News
logo
CPP - Interview Questions
What is Inline Function in C++?
Inline Function is nothing but simply a function for which the C++ compiler produces a copy of it every time the function is called during compilation. It is an important feature that rose out from classes and objects in C++. 
 
If any changes are made to an inline function, the section of the code containing the function is again compiled and necessary changes in the copies of the code are made, otherwise, it would continue to work according to the old code.
 
In order to indicate that a function is inline, we use the keyword “inline” in C++.
 
The general syntax for declaring an inline function in C++ is :
inline return_type function_name( arguments )
{
// BODY OF THE FUNCTION
}
Advertisement