In PHP you can do something like this
function thisIsAFunction() {}$functionName = "thisIsAFunction";$functionName();
Is there a way to do something simliar?
I'm asking this because i'm creating a timer class for my game. I want to be able to create a timer, and pass along the name of the function to call from the object (which i also pass when creating the function).
I thought about passing the function just as it is. But this causes some trouble. I would have to know the class of the object im passing first, which i just can't figure out.
Edit
I found the preprocessor "stringify" character: #. It converts a variable into a string, or something like that. Is this something i can use? Tried putting it into a macro, but got: ("#" may not appear in macro parameter list) thrown back at me. Am i completly wrong here?