TIP: Click on subject to list as thread! ANSI
echo: aust_c_here
to: Sam Benson
from: Paul Edwards
date: 1996-05-31 02:26:34
subject: Understanding recursion

SB> void reverse (char line_in[], int index)
SB> {
SB>     if (line_in[index])
SB>     {
SB>         printf ("%c", line_in[index]);
SB>         index++;

Because you have incremented index above, it's value will be 1.

SB>         reverse (line_in, index);
SB>     }
SB>     printf ("%c", line_in[index]);

So this line will never be executed with index = 0.

BFN.  Paul.
@EOT:

---
* Origin: X (3:711/934.9)

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.