As the title says; what\'s the difference in practice between the inline keyword and the #define preprocessor directive?
Macros (created with #define
) are always replaced as written, and can have double-evaluation problems.
inline
on the other hand, is purely advisory - the compiler is free to ignore it. Under the C99 standard, an inline
function can also have external linkage, creating a function definition which can be linked against.