2 ms·
I've found using a macro makes function pointers really easy. Learnt this from Handmade Hero: #define SOME_FUNCTION(name) void name(int Arg0, float Arg1)
by Randdalf 9y ago
I've found using a macro makes function pointers really easy. Learnt this from Handmade Hero:
#define SOME_FUNCTION(name) void name(int Arg0, float Arg1)
typedef SOME_FUNCTION(some_function);
SOME_FUNCTION(SomeFunction)
{
}
struct some_functions
{
some_function* Foo;
some_function* Bar;
};
// Either works here.
some_functions SomeFunctions;
SomeFunctions.Foo = &SomeFunction;
SomeFunctions.Bar = SomeFunction;