What is an inline function?

What is an inline function?

Inline function means compiler replaces a function call with the corresponding function body

Why we use the inline function?

The program run faster and take less space because of the elimination of function calling overhead

When inline functions are used?

Usually, functions are made into inline when they are small enough defined in one or two lines of code

We don’t use the inline function in the big function

Syntax: inline  return-type function name(parameter declaration)

               {

                 Function body

               }

The call is completely replaced by the function  body

Leave a Reply

Your email address will not be published.