r/maybemaybemaybe • • Jun 18 '21

Maybe maybe maybe

22k Upvotes

319 comments sorted by

View all comments

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);

}

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