Amazon Interview Question
Software Engineer / Developers1. There is no such thing like recursive macro ( according to c++ standards)
2. Recursive inline functions are valid. But depends on how the compiler handle/optimize them. The compiler will either recurse for a certain depth and then consider them as normal functions. Or if the function recursion is HUGE, then the compiler might treat them as normal functions.
Please correct me if I am wrong.
1. There is no such thing like recursive macro ( according to c++ standards)
2. Recursive inline functions are valid. But depends on how the compiler handle/optimize them. The compiler will either recurse for a certain depth and then consider them as normal functions. Or if the function recursion is HUGE, then the compiler might treat them as normal functions.
Please correct me if I am wrong.
stackoverflow.com/questions/190232/can-a-recursive-function-be-inline
- GekkoGordan February 08, 2011