RosettaCodeData/Task/Repeat/C/repeat.c
2023-07-01 13:44:08 -04:00

15 lines
220 B
C

#include <stdio.h>
void repeat(void (*f)(void), unsigned int n) {
while (n-->0)
(*f)(); //or just f()
}
void example() {
printf("Example\n");
}
int main(int argc, char *argv[]) {
repeat(example, 4);
return 0;
}