Wednesday 26 March 2014

Explain inline funtion in c

Posted by Саша 00:05, under | No comments


Explain inline funtion in c++? Explain inline funtion in c++?

inline function in C++, specifically, is a function that can be defined in multiple translation units. Typically this means that the body of the function may be placed entirely in a header file, and that header file can be included in several source files, which can then be linked together into a single executable.

If you place a function definition in a header file and don't specify it 'inline', you'd get linker errors reporting that the function is multiply defined. If the function is inline, this is allowed.

The keyword 'inline' also used to carry an additional meaning of optional suggestion to the optimizer to inline the function (that is, place the body of the function at the site of call), but that has not been the case for at least a decade: inlining decisions are made with no regard to the inline specifier.


Other Answers:













0 коммент.:

Post a Comment