What is an inline function in C language?

CServer Side ProgrammingProgramming

The inline function can be substituted at the place where the function call is happening. Function substitution is always compiler choice.

  • In an inline function, a function call is replaced by the actual program code.

  • Most of the Inline functions are used for small computations. They are not suitable for large computing.

  • An inline function is similar to a normal function. The only difference is that we place a keyword inline before the function name.

Inline functions are created with the following syntax −

inline function_name (){
   //function definition


Following is the C program for inline functions −

inline int mul(int a, int b) //inline function declaration{
int main(){
   int c;
   return 0;


When the above program is executed, it produces the following result −

Published on 08-Mar-2021 11:00:25