Needed explanation

Hi, I need help with this code :

1. # include <iostream>
2. # include <cctype>
3. using namespace std;
4.
5. int recursion(int array[], int temporarly, int last)
6. {
7. if (temporarly == last)
8. return array[temporarly];
9. int temp = recursion(array, temporarly + 1, last);
10. return ((array[temporarly] < temp) ? array[temporarly] : temp);
11. }
12.
13. void main()
14. {
15. int array[] = { 15, 13, 10, 15, 13 };
16. char * text = "Recursion - function... ";
17. char * point = text + recursion(array, 0, 4);
18. cout << recursion(array, 0, 4) << endl;
19. cout << point << endl;
20.
21. system("pause");
22. }

I need help with line 9. and 17.
I get the rest of the code perfectly but I miss the main thing in these lines.
Please help!
Thanks in advance.
closed account (10X9216C)
I feel like if you don't know what lines 9 and 17 do, you don't know what the entirety does.

Line 9 is exactly what the function name suggest it does, that is the recursive call.

Line 17, you need to know what recursion returns.
First thing I must ask is "Do you know Recursive?"
If not, try google it, it not hard to understand(But hard in implementation).

This program gives you the most little number of the array.

btw, the variable char * point = text + recursion(array, 0, 4); print text with skipped.
Last edited on
myesolar & lsk thanks for the tips I will google it and find out (:
Topic archived. No new replies allowed.