For example:
#include
typedef void (* proto_1)();
typedef void proto_2();
void my_function(int j){
printf(\"hello from function. I got
there is no difference between &function and function when passing as arguement
however there is a difference between your typedefs. I do not know the official explanation, i.e what exactly the difference, but from what i remember
typedef void (*name1)(void);
and
typedef void(name2)(void);
are different:
name1 is a pointer to a function that takes no paramter and returns nothing
name2 is a function that takes no paramter and returns nothing
you can test it by compiling:
typedef void (*pointer)(void);
typedef void (function)(void);
void foo(void){}
int main()
{
pointer p;
function f;
p = foo; //compiles
p();
f = foo; //does not compile
f();
}
again, i am not the right person to explain exact reason of this behavior but i believe if you take a look at standards you will find the explanation somewhere there