Debugging Recursive functions
-
can anyone tell me how to debug and test recrusive functions??? i have trying putting trace statements and using the VC++ debugger but i always get lost on what i was doing. i trying looking at the call stacks but it is useless. Can anyone tell me what's the most efficient and the most easiest way to debug my recrusive function???? Thank you very much, John :-D Aloha from Hawaii :-)
-
can anyone tell me how to debug and test recrusive functions??? i have trying putting trace statements and using the VC++ debugger but i always get lost on what i was doing. i trying looking at the call stacks but it is useless. Can anyone tell me what's the most efficient and the most easiest way to debug my recrusive function???? Thank you very much, John :-D Aloha from Hawaii :-)
I like to put a static nesting counter in temporarily to tell how many iterations deep I am. If a problem appears, I record how many levels deep I am, then it becomes easier to set breakpoints for the particular iteration. Other than that I like to initialize the values in the function during runtime to test all of my exit cases.