Basically I have a command structure that contains some information about that specific command, including a function pointer:
Code: Select all
void (*function_pointer)();
Code: Select all
void Command_List_Add_Command(char* name, char* description, void (*function_pointer)());
//Assignment
command_list[command_count].function_pointer = function_pointer;
Code: Select all
Command_List_Add_Command("help", "Displays all available commands.", Commands.Help);
Side note: all the commands are located in a separate C++ file. "Commands" is an instance/object of "Commands_Class" class.
I tried everything I remembered of, nothing seemed to be okay. I even trying declaring an external "C" virtual function, that did compile but I was getting opcode exceptions, general protection fault exceptions, etc...
I would appreciate any help.