Anonymous user
Apply a callback to an array: Difference between revisions
m
→{{header|C}}: - ww (nothing special, it's C) ; desectioned
(added Ursala) |
m (→{{header|C}}: - ww (nothing special, it's C) ; desectioned) |
||
Line 116:
=={{header|C}}==
<lang c>#ifndef CALLBACK_H▼
▲===callback.h===
<lang c>▼
▲#ifndef CALLBACK_H
#define CALLBACK_H
Line 136 ⟶ 132:
void map(int* array, int len, void(*callback)(int,int));
#endif</lang>
<lang c>#include <stdio.h>
#include "callback.h"
Line 167 ⟶ 161:
map(array, 4, callbackFunction);
return 0;
array[0] = 1
|