Is it worth it to use the inline keyword or the compiler is smart enough to know when he needs to inline a function ?
Yes, it is smart enough. But what has made no progress at all in the past 40 years is the way C programs are built. It is still one source code file at a time.
So to get a function inlined in more then one .c file you put the function definition in the .h file. And if you don't mark them inline, the linker will complain about the multiple definitions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With