I forgot () at the end of function call, but got no errors?

I don't know if this is the right way to do this or not. I'm a completely self taught programmer. But it works and uses the same syntax.

Most of my projects boil down to state machine code. I'll make an enum to name all the states and keep everything in arrays I can use those names to index. I'll register all the callbacks in an array of function pointers. So registering a callback might look like.

void someCallback()
{   ...  some code to run   }


callback_array[SOME_STATE] = someCallback;

Then the loop function might have:

if (callback_array[current_state]) callback_array[current_state]();

and someCallback will be called if current_state == SOME_STATE where current state is typed to the enum I made to hold the state names.

If a callback is not registered, then the array will have a NULL there and that will keep the function from being called. It gets paired up a lot with an else statement that adds a new callback function.