Is it possible to make an inline recursive function? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Is it possible to make an inline recursive function?

26th Feb 2017, 9:06 AM
mahmood motallebi
mahmood motallebi - avatar
2 Answers
+ 1
According to my knowledge, inline functions, - Commonly used for calculation. - The function call is replaced with the function logic at the time of compilation. - Make execution faster. - Compiled code is relatively bigger. Yes recursion is possible with inline function, given that the function is optimize tail recursive where there is no further computation after the recursive call. inline unsigned int product (unsigned int n,unsigned int m) { return m == 1 ? : n + product (n,m - 1); }
12th Mar 2017, 3:16 PM
देवेंद्र महाजन (Devender)
देवेंद्र महाजन (Devender) - avatar