The inline specifier tells the compiler to expand a function’s code inline rather than calling the function. The inline specifier is a request, not a command, because several factors may prevent a function’s code from being expanded inline. Some common restrictions include recursive functions, functions that contain loops or switch statements, or functions that contain static data. The inline specifier precedes the rest of a function’s declaration.

The following tells the compiler to generate inline code for myfunc( ):

inline void myfunc(int i) {   // ... }

When a function’s definition is included within a class declaration, that function’s code is automatically inlined, if possible.

C(s)C++ Programmer's Reference
C Programming on the IBM PC (C Programmers Reference Guide Series)
ISBN: 0673462897
EAN: 2147483647
Year: 2002
Pages: 539 © 2008-2017.
If you may any questions please contact us: