There's a trick I read about on the man page of dlopen. There is another way to assign to a function pointer by way of void * (like dlopen and GetProcAddress return). Instead of casting the return type, you cast the variable you're assigning to. It's less code than what Casey used on stream. It's A-OK according to POSIX, so it should work pretty much anywhere. The big advantage is assigning to a struct or an array of function pointers, because you can do this in a loop.
| *(void **)(&function_pointer) = GetProcAddress("function_name");
|