---
title: "What is Inline Function?"  
description: "What is Inline Function?"  
author: "Shikhar Arora"  
published: 2019-12-06  
canonical: https://answers.mindstick.com/qa/92527/what-is-inline-function  
category: "technology"  
tags: ["software engineering", "programming language"]  
reading_time: 1 minute  

---

# What is Inline Function?

What is [Inline Function](https://www.mindstick.com/interview/2269/what-do-you-mean-by-inline-function)

## Answers

### Answer by Sangsaptak Pal

[Inline](https://www.mindstick.com/interview/1012/describe-the-difference-between-inline-and-code-behind) [function](https://www.mindstick.com/articles/43970/purchase-suitable-wedding-dresses-for-your-wedding-function) is one of the most important features in C++ programming

Inline function is a function that is expanded in the line at which it is called. When the inline function is called, the whole code of the inline function gets inserted or substituted at the point of the calling of the inline function. This substitution is performed by the C++ compiler during the compile time. Inline function may increase the efficiency of the program if it is small. Inlining is only a request to the compiler not a command. The compiler can ignore the request for inlining. Compiler may not perform inlining in circumstances if the function contains :

- A loop
- Contains static variables
- Is recursive
- Contains switch or goto statement

Advantages of inline function :

- Function call overhead does not occur.
- It saves the overhead of a return call from a function
- It saves the overhead of push/pop variables on the stack when function is called


---

Original Source: https://answers.mindstick.com/qa/92527/what-is-inline-function

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
