devxlogo

June 7, 2005

Using Recursion Efficiently

It’s important to use recursion carefully to avoid running into stack overflow. This sample code reverses a given integer number using recursion: #include “stdafx.h”int myreverse(int num){ static int nLocal =