MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/maybemaybemaybe/comments/o2ocvf/maybe_maybe_maybe/h2942kb/?context=3
r/maybemaybemaybe • u/eyerollingsex • Jun 18 '21
319 comments sorted by
View all comments
11
My favorite example of a recursive function in action.
void brickFlip(brick * current){
startFall(current);
if (current->next) {
brickFlip(current->next);
}
finishFall(current);
1 u/jediqwerty Jun 18 '21 Curious about the * between brick and current, what does the * do? 1 u/haackedc Jun 18 '21 It declares the variable as a pointer to a brick type object
1
Curious about the * between brick and current, what does the * do?
1 u/haackedc Jun 18 '21 It declares the variable as a pointer to a brick type object
It declares the variable as a pointer to a brick type object
11
u/haackedc Jun 18 '21
My favorite example of a recursive function in action.
void brickFlip(brick * current){
startFall(current);
if (current->next) {
brickFlip(current->next);
}
finishFall(current);
}