---
title: "How to create a inline function C plus plus?"  
description: "How to create a inline function C plus plus?"  
author: "Anonymous User"  
published: 2013-06-14  
updated: 2013-06-15  
canonical: https://www.mindstick.com/forum/1107/how-to-create-a-inline-function-c-plus-plus  
category: "visual c++"  
tags: ["visual c++"]  
reading_time: 1 minute  

---

# How to create a inline function C plus plus?

Hi [Expert](https://www.mindstick.com/articles/13120/an-expert-financial-advice-will-improve-your-finances),\
How to create a [inline function](https://www.mindstick.com/interview/2269/what-do-you-mean-by-inline-function) [c++](https://www.mindstick.com/blog/745/array-in-c-plus-plus)? Can you provide me line of code.\
Thanks in advance.

## Replies

### Reply by AVADHESH PATEL

Try as following line of code:\
In line [function](https://www.mindstick.com/articles/13001/multi-statement-table-valued-user-defined-function-in-sql-server) is created with the help of [inline](https://www.mindstick.com/interview/1012/describe-the-difference-between-inline-and-code-behind) specifier.e.g.-

```
inline int even(int x){ return !(x%2);}int main( ){ if(even(10)) cout<<"10 is even\n";if(even(11)) cout<<"11 is even \n";return 0;}
```


---

Original Source: https://www.mindstick.com/forum/1107/how-to-create-a-inline-function-c-plus-plus

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
