5. Can inline functions have a recursion?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
What are containers in c++?
Can I uninstall microsoft c++ redistributable?
Can java be faster than c++?
What is virtual destructors? Why they are used?
How would you call C functions from C++ and vice versa?
Difference between an inspector and a mutator
What are guid?
Which is better c++ or java?
What does flush do?
Implement strncpy
Explain unexpected() function?
this is to swap to strings....but in output the whole strings are swapped leaving first as it is...why it is so #include<iostream.h> int main() { char a[]="ajeet"; char b[]="singh"; long x=*a; long y=*b; cout<<x<<":"<<y; x=x+y; y=x-y; x=x-y; *a=x; *b=y; cout<<x<<":"<<y; cout<<&a<<endl; cout<<&b<<endl; }