Original Post
I am writing a simple scripting engine and I need to be able to call functions dynamicly. The following source shows what I am trying to achieve.
FindCommand checks the list of registered commands to make sure it exists. Thanks in advance.
int ExecuteCommand(char *command, char *args[16])
{
void (*funcptr)(void);
if(FindCommand(head, "quit") == NULL)
printf("\nCommand Not Found");
funcptr = command;
funcptr();
//execute and get return value
return (1);
}
|