![]() |
|
#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 11: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. __________________
During the election they said Obama could only be elected when pigs fly. Well, we currently have an epidemic of Swine Flu. Coincidence? |
Recent GIDBlog
Once again, no time for hobbies 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 16:17 |
| help in c++ recursive functions | vinch | C++ Forum | 7 | 04-Jan-2006 13:22 |
| Recursive functions using pointers | kai85 | C++ Forum | 12 | 03-Aug-2005 14:52 |
| Understanding Recursive Functions | Nexa | C++ Forum | 5 | 19-Nov-2004 12:51 |
| conflict between printf and stdarg.h va functions | mirizar | C Programming Language | 3 | 12-Jul-2004 09:11 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The