debugging recursive functions

Mar 10, 2011 at 5:55pm
what is the best known method for debugging a recursive function ??
how do i make things print and make sense of things it is doing ?
any standard or generally used guidelines ?
Mar 10, 2011 at 6:51pm
If you want something pretty, you can use a static variable inside the function to count how many times you have recursed and place spaces to indent information for that call. Printing the parameters and possibly the value you are going to return may be useful as well.
Topic archived. No new replies allowed.