I am practicing recursion in C on my own and I found this example online. However there is one thing I don\'t understand.
void singSongFor(int numberOfBottle
The reason it works in this way is that every call of the singSongFor() where numberOfBottles is more than 1 will in turn recursively call singSongFor() until numberOfBottles is 0. At this point printf("There are simply no more bottles of beer on the wall.\n\n") is reached and that function will finish, passing up to the calling function, which will have had an argument of 1 passed in, which then reaches printf("Put a bottle in the recycling, %d empty bottles in the bin.\n", numberOfBottles); and itself completes, returning to singSongFor(2)... and so on until you're back at your original number, 4 in this case.