Difference between revisions of "Inline Specifier"

From Embedded Systems Learning Academy
Jump to: navigation, search
(Created page with "'''inline''' is a specifier for a function in C/C++ that tells the compiler to replace the function call in assembly with the contents of the function. === Basic Example of t...")
 
Line 1: Line 1:
'''inline''' is a specifier for a function in C/C++ that tells the compiler to replace the function call in assembly with the contents of the function.
+
'''inline''' is a specifier for a function in C/C++ that tells the compiler to replace the function call in assembly with the contents of the function. It is most often used when tying to speed up a program as it takes out the overhead of a function call. it is particularly useful with small functions that are called often. However, the specifier will also increase the size of your program as it takes away the benefit of re-usability at the assembly level.
  
=== Basic Example of the '''inline''' specifier ===
+
=== Basic Example of the '''inline''' Specifier ===
  
  
 
=== '''inline''' Specifier With a Recursive Function ===
 
=== '''inline''' Specifier With a Recursive Function ===

Revision as of 00:36, 15 December 2016

inline is a specifier for a function in C/C++ that tells the compiler to replace the function call in assembly with the contents of the function. It is most often used when tying to speed up a program as it takes out the overhead of a function call. it is particularly useful with small functions that are called often. However, the specifier will also increase the size of your program as it takes away the benefit of re-usability at the assembly level.

Basic Example of the inline Specifier

inline Specifier With a Recursive Function