C inline function (inline)
What is inline function
The inline function is to solve a solution to solve the problem of the C preprocessor macro, to improve the inline function definition of function use efficiency
The inline function uses the Inline keyword definition, and the function body and the declaration must be combined, otherwise the compiler treats him as a normal function.
Inline void function (int x); // is only a declaration function, without any effect inline void function (int x) // correct {RETURN X;} The function of the internal definition in the class is automatically inline function, no need Add key inline.
Class Point {INT I; PUBLIC: Void SetValue (int X) // Inline function {i = x;}} The difference between inline functions and normal functions
Ordinary function: The compiler places the function type in its symbol table (including the number of function prototypes and functions of the name and parameter type). Inline function: The code of the function is also placed in a symbol table, and the code is stored in the form of a source or compiled assembly instruction depending on the compiler. When the inner function is too complex, the compiler will not perform inline.