You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
412 B
C
22 lines
412 B
C
#include <stdio.h>
|
|
|
|
void void_callback(void (*p_func)())
|
|
{
|
|
printf("Wrapped function start\n");
|
|
(*p_func)(); //callback
|
|
printf("There I called your shitty function\n");
|
|
};
|
|
|
|
void say_dirp()
|
|
{
|
|
printf("DIRP!!!\n");
|
|
}
|
|
|
|
int main(void)
|
|
{
|
|
void (*ptr)() = &say_dirp; // Ok so this is a weird way to declare pointer to a function but I guess that's what c has.
|
|
|
|
void_callback(ptr);
|
|
|
|
return 0;
|
|
} |