5. Can inline functions have a recursion?

Answer Posted / jeremiah

A function that is marked "inline" can also be recursive.
- The "inline" keyword on a function definition is only a
suggestion to the compiler that this function is a good
candidate for inlining. The compiler will still have the
final say if the function can be inlined or not.
- In certain cases a function cannot be inlined even if it
has the "inline" modifier:
* You use the function as a callback which requires a
pointer to the function.
* You make a recursive call to the function that has been
marked inline. In this case, the compiler can't determine
the base case for the recursive function and theirfor can't
unroll the inline function in the recursive call. Then an
external version of the function is required.

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between structure and class?

792


What do you mean by function and operator overloading in c++?

797


What is c++ library?

786


List the special characteristics of constructor.

912


Explain the difference between c & c++?

794


What are the advantages of c++?

1268


What are the three forms of cin.get() and what are their differences?

828


What is the size of integer variable?

787


What is an overflow error?

821


What it is and how it might be called (2 methods).

838


write a corrected statement in c++ so that the statement will work properly. x = y = z + 3a;

1639


What is while loops?

799


What is the benefit of c++?

788


What is different in C++, compare with unix?

797


What is the use of object in c++?

804