The following statement (and included code example) is from a textbook discussion of recursive functions, and I am unclear as to the meaning of "return". Is there an implied
in all void functions that is part of the C Standard?
Quote:
"When program flow reaches the return at the end of the last recursion level, control passes to the previous recursion level."
|
Code:
#include <stdio.h>
void up_and_down(int);
int main(void)
{
up_and_down(1);
return 0;
}
void up_and_down(int n)
{
printf("Level %d: n location %p\n", n, &n); // 1
if (n < 4)
up_and_down(n+1);
printf("LEVEL %d: n location %p\n", n, &n); // 2
}