Skip to content

Instantly share code, notes, and snippets.

@Veejay
Created April 21, 2010 10:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Veejay/373688 to your computer and use it in GitHub Desktop.
Save Veejay/373688 to your computer and use it in GitHub Desktop.
void* recursive_fold(struct node* head, void* seed, void*(*fun)(void*, void*))
{
if(!head){
return seed;
}
else return fun(head->data, recursive_fold(head->next, seed, fun));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment