5. Can inline functions have a recursion?

Answers were Sorted based on User's Feedback



5. Can inline functions have a recursion?..

Answer / 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

5. Can inline functions have a recursion?..

Answer / anjali

No inline function dnt hv recursion because inline function
cantains one or two line code only

Is This Answer Correct ?    6 Yes 5 No

5. Can inline functions have a recursion?..

Answer / nilay

It can have but the size of .obj (compiled) file(on
windows, .o on unix platform ) increases . so it is not
advisable to dos so.

Is This Answer Correct ?    0 Yes 2 No

5. Can inline functions have a recursion?..

Answer / prashanth c patel

inline function are recursive.

Is This Answer Correct ?    2 Yes 7 No

Post New Answer

More C++ General Interview Questions

Difference between overloading vs. Overriding

0 Answers  


How do you invoke a base member function from a derived class in which you have not overridden that function?

0 Answers  


How would you obtain segment and offset addresses from a far address of a memory location?

0 Answers  


Write a corrected statement in c++ so that the statement will work properly. if (x > 5); y = 2*x; else y += 3+x;

1 Answers  


How can I disable the "echo" feature?

0 Answers  






What is flush () in c++?

0 Answers  


What is #include cstdlib in c++?

0 Answers  


What are pointer-to-members in C++? Give their syntax.

0 Answers   HAL,


What are pointers used for c++?

0 Answers  


Write is a binary search tree? Write an algo and tell complexity?

0 Answers   Axtria,


What is a hashmap c++?

0 Answers  


Do inline functions improve performance?

0 Answers  


Categories