I hate to be pedantic, but what you're describing is functional composition. The key to recursion is that the function calls itself. e.g. int factorial(int n) // assumes n > 0 { if (n > 1) return n * factorial( n - 1); // the recursive call, this is (...) (26 years ago, 11-May-99, to lugnet.robotics)
|