An inline function is a function in C and C++ programming languages qualified with the keyword inline which tells the compiler to substitute the body of the function inline by performing inline expansion i.e. by inserting the function code at the address of each function call thereby saving the overhead of function invocation and return (register saving and restore) by avoiding a jump to a sub-routine. The keyword inline function is similar to a macro as the compiler places a new copy of the inline function in each place it is called. Inline functions run a little faster than the normal functions as function-calling-overheads are saved, however, there is a memory penalty. If an inline function is called 10 times, there will be 10 copies of the function inserted into the code. Hence inline functions are best for small functions that are called often. The member functions of a class, if defined within the class definition, are inlined by default (no need to use the inline keyword); otherwise, the keyword is needed. The compiler may ignore the programmer’s attempt to inline a function, mainly if it is particularly large.
This video is targeted to blind users.
Attribution:
Article text available under CC-BY-SA
Creative Commons image source in video
On this page of the site you can watch the video online Inline function with a duration of hours minute second in good quality, which was uploaded by the user Audiopedia 24 October 2014, share the link with friends and acquaintances, this video has already been watched 3,807 times on youtube and it was liked by 5 viewers. Enjoy your viewing!