Can inline functions have a recursion? Give the reason?
Answer Posted / 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 |
Post New Answer View All Answers
What does count ++ do in c++?
What do the keywords volatile and mean mutable?
What data structure is fastest, on average, for retrieving data: a) Binary Tree b) Hash Table c) Stack
I was a c++ code and was asked to find out the bug in that. The bug was that he declared an object locally in a function and tried to return the pointer to that object. Since the object is local to the function, it no more exists after returning from the function. The pointer, therefore, is invalid outside.
What is size_type?
What is a pointer how and when is it used?
Can I run c program in turbo c++?
Can java be faster than c++?
Explain selection sorting?
What is the use of main function in c++?
How would you implement a substr() function that extracts a sub string from a given string?
What does override mean in c++?
When the constructor of a base class calls a virtual function, why doesn't the override function of the derived class gets called?
What is difference between rand () and srand ()?
Explain the static member function.