C++ Programmer Question: Download C++ Programmer PDF

Explain is it possible to have a recursive inline function?

Tweet Share WhatsApp

Answer:

Although you can call an inline function from within itself, the compiler may not generate inline code since the compiler cannot determine the depth of recursion at compile time. A compiler with a good optimizer can inline recursive calls till some depth fixed at compile-time (say three or five recursive calls), and insert non-recursive calls at compile time for cases when the actual depth gets exceeded at run time.

Download C++ Programmer PDF Read All 59 C++ Programmer Questions
Previous QuestionNext Question
Tell me is it possible to get the source code back from binary file?Do you know who designed C++ programming language?