Can inline functions have a recursion? Give the reason?
Answers were Sorted based on User's Feedback
Answer / guest
Calling the by itself, then the function is no longer
called as Inline. Compiler never know how depth of the
recursion at compilation time. Therefore inline functions
cant have a recursion
| Is This Answer Correct ? | 14 Yes | 2 No |
Answer / sandeep mannarakkal
Inline is a request to the compiler , i.e it may get rejected for the following reasons,
1) If there is recursion (recursion have stack over stack, but inline don't have stack)
2) If static variable is available inside inline function
3) if function definition and implementation are available at different files
4) If there is a function pointer to inline function
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / siva
I have tested The answer is....
Yes, you can use but Not preferable.
Inline functions are expanded as macros at compile time.
Generally inline is used if the function has fewer lines of
code.
| Is This Answer Correct ? | 6 Yes | 9 No |
Define whitespace in C++.
why the size of an empty class is 1
What is the difference between static link library and dynamic link library?
What is void pointer in c++ with example?
What is a binary file? List the merits and demerits of the binary file usagein C++.
check whether a no is prime or not.
What do the header files usually contains?
What are separators in c++?
Can circle be called an ellipse?
What do you mean by function overriding & function overloading in c++?
What are raw sockets, where they are efficient?
Can we use struct in c++?