What are “Inline” functions in C?

in #c4 years ago

Hi! In this video we will speak about what are “Inline” functions in C programming language? This is a very common C programming interview question and I hope that this video will help you.

In the C and C++ programming languages, an inline function is one qualified with the keyword inline; "inline" serves as a compiler directive that suggests (but does not require) that the compiler substitute the body of the function inline by inserting the function code at the address of each function call, thereby saving the overhead of a function call.
Also "inline" change the linkage behavior, this is necessary due to the C/C++ separate compilation + linkage model, specifically because the definition of the function must be duplicated in all translation units where it is used, to allow inlining during compiling, which, if the function has external linkage, causes a collision during linking.[https://en.wikipedia.org/wiki/Inline_...]

Usefull links:
https://en.wikipedia.org/wiki/Inline_...
https://gcc.gnu.org/onlinedocs/gcc/Op...
https://www.greenend.org.uk/rjk/tech/...
https://gcc.gnu.org/onlinedocs/gcc/In...

Hello and welcome to my channel, I am “Code Shepherd”and in this video we have another C embedded interview question and I will try to give you the best answer for it.

Please comment below what do you think about this video, and what kind of videos you think I should make next...

See you next time!

Special thanks:
Petronela L.
Tudor A.

If you like this video, please like and subscribe to my channel

Intro video: https://www.pexels.com/
Intro music: https://www.youtube.com/audiolibrary/... ...Viking(
Aakash Gandhi)