![]() |
|
#1
|
|||
|
|||
Need Help With Recursive FunctionsHere is my code:
CPP / C++ / C Code:
I am having trouble figuring out what this code does. With my limited knowledge of reading code(correct me if I am wrong) If the integer size is larger than zero the first element of A will be set to zero, then recursion calls the Clueless function again and sets the pointer to first element to -1(isnt this the final number in the array?) So will the recursive function set just the first element to zero, or will it set the last element to zero, or will all elements be set to zero, or finally wil it create a infinite loop? Last edited by LuciWiz : 31-Jul-2006 at 10:17.
Reason: Please insert your C/C++ code between [cpp] & [/cpp] tags
|
|
#2
|
||||
|
||||
Re: Need Help With Recursive FunctionsQuote:
This function zeros an array of size elements. In effect: Code:
Before the if you can put print/cout statements to see exactly what each call of the function sees. __________________
Age is unimportant -- except in cheese |
Recent GIDBlog
Meeting the populace by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Performance comparison between recursive and iterative functions | earachefl | C++ Forum | 1 | 21-Mar-2006 15:17 |
| help in c++ recursive functions | vinch | C++ Forum | 7 | 04-Jan-2006 12:22 |
| Recursive functions using pointers | kai85 | C++ Forum | 12 | 03-Aug-2005 13:52 |
| Understanding Recursive Functions | Nexa | C++ Forum | 5 | 19-Nov-2004 11:51 |
| conflict between printf and stdarg.h va functions | mirizar | C Programming Language | 3 | 12-Jul-2004 08:11 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The