Embedded Software Engineer Question:

Tell me what happens when recursive functions are declared inline?

Tweet Share WhatsApp

Answer:

Inlining an recursive function reduces the overhead of saving context on stack. But, inline is merely a suggestion to the compiler and it does not guarantee that a function will be inlined. Obviously, the compiler won't be able to inline a recursive function infinitely. It may not inline it at all or it may inline it, just a few levels deep.

Download Embedded Software Engineer PDF Read All 100 Embedded Software Engineer Questions
Previous QuestionNext Question
Please explain what is semaphore?Tell me what is difference between binary semaphore and mutex?