c function parameter code example
Example 1: passing a function as an argument in c
void func ( void (*f)(int) ) {
for ( int ctr = 0 ; ctr < 5 ; ctr++ ) {
(*f)(ctr);
}
}
Example 2: passing a function as an argument in c
void func ( void (*f)(int) );
Example 3: function in c
#include <stdio.h>
void function(){
printf("I am a function!");
}
int main(void) {
function();
}