
- C Programming Tutorial
- C - Home
- C - Overview
- C - Environment Setup
- C - Program Structure
- C - Basic Syntax
- C - Data Types
- C - Variables
- C - Constants
- C - Storage Classes
- C - Operators
- C - Decision Making
- C - Loops
- C - Functions
- C - Scope Rules
- C - Arrays
- C - Pointers
- C - Strings
- C - Structures
- C - Unions
- C - Bit Fields
- C - Typedef
- C - Input & Output
- C - File I/O
- C - Preprocessors
- C - Header Files
- C - Type Casting
- C - Error Handling
- C - Recursion
- C - Variable Arguments
- C - Memory Management
- C - Command Line Arguments
- C Programming useful Resources
- C - Questions & Answers
- C - Quick Guide
- C - Useful Resources
- C - Discussion
What is an inline function in C language?
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 }
Example
Following is the C program for inline functions −
#include<stdio.h> inline int mul(int a, int b) //inline function declaration{ return(a*b); } int main(){ int c; c=mul(2,3); printf("Multiplication:%d
",c); return 0; }
Output
When the above program is executed, it produces the following result −
6
- Related Articles
- What is strncpy() Function in C language?
- What is strrev() Function in C language?
- What is strlen function in C language?
- What is strcoll() Function in C language?
- What is strspn() Function in C language?
- What is strcpy() Function in C language?
- What is strcat() Function in C language?
- What is strncat() Function in C language?
- What is strcmp() Function in C language?
- What is strncmp() Function in C language?
- What is strstr() Function in C language?
- What is function prototype in C language
- What is exit() function in C language?
- What is strtok() function in C language?
- What is strtok_r() function in C language?

Advertisements