I'm trying to figure out the following code. Especially the part that relates to the function typedef.
#include <stdio.h>
void foo1(int var1, int var2); // foo1 decleration
typedef void (foo2)(int var1, int var2); // what is this exactly?
typedef struct somestruct{
foo2* somefunc;
}SOMESTRUCT;
int main()
{
SOMESTRUCT struct1;
struct1.somefunc = &foo1;
struct1.somefunc(1,5);
return 0;
}
void foo1(int var1, int var2){
printf("this is function inside struct var1 = %d var2 = %d",var1, var2);
}