Hey Guys/Gal's
I'm trying to figure out how to make an array of function pointers, but let me explain what i mean:
The array will need a 'key' value (string | char*) and a 'value' (function pointer). So basically the array holds a list of short names of functions. I need to be able to call the functions by their short name, somehow like
someArray["Print"](); // I understand this is probably not correct
And that will call what ever function the value at 'Print' is pointing too. However, each function pointer will be different..
So for example i can somehow do:
void hello(void){ cout << "hello world\n"; }
void (*myPointer)(void) = NULL;
myPointer = &hello;
// then
myArray["hello"] = myPointer; // etc...
I hope you understand what I mean. Thank you for your help!
Cheers, Tristan.