I\'m learning how to dynamically load DLL\'s but what I don\'t understand is this line
typedef void (*FunctionFunc)();
I have a few questio
typedef
is used to alias types; in this case you're aliasing FunctionFunc
to void(*)()
.
Indeed the syntax does look odd, have a look at this:
typedef void (*FunctionFunc) ( );
// ^ ^ ^
// return type type name arguments
No, this simply tells the compiler that the FunctionFunc
type will be a function pointer, it doesn't define one, like this:
FunctionFunc x;
void doSomething() { printf("Hello there\n"); }
x = &doSomething;
x(); //prints "Hello there"