-
Notifications
You must be signed in to change notification settings - Fork 332
Open
Labels
Description
It might be convinient for collections to have a fold/reduce function so that you may do something like this:
void fn(void *e1, void *e2, void *result)
{
int el1 = *((int*)e1);
int el2 = *((int*)e2);
*((int*) reslut) = el1 + el2;
}
...
// accumulate values of array into result
int reslut;
array_reduce(array, fn, &result);alexpana and vuonghv