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

Why can you not make a constructor as const?

3 Answers  


What is this weird colon-member (" : ") syntax in the constructor?

0 Answers  


What is the difference between the compiler and the preprocessor?

0 Answers  


What is c++ good for?

0 Answers  


What is c++ in english?

0 Answers  






Can I have a reference as a data member of a class? If yes, then how do I initialise it?

0 Answers  


Given an array of size N in which every number is between 1 and N, determine if there are any duplicates in it. You are allowed to destroy the array if you like. [ I ended up giving about 4 or 5 different solutions for this, each supposedly better than the others ].

1 Answers  


Define pre-condition and post-condition to a member function in c++?

0 Answers  


what are the iterator and generic algorithms.

0 Answers  


why c++ is not called strictly d super set of c?

3 Answers   Satyam,


sir there is some problem with nokia5130c-2,when we are trying to upload movies from net then there is a error occurred"FORMAT NOT SUPPORTED" bt its all ready in 3gp format.please tell me what i do now?

2 Answers   Nokia,


Can java be faster than c++?

0 Answers  


Categories