OK, so that's what I need :
- Let's say we've got a string variable, e.g.
func
with some value, given by the user (not a constant) - How could we call a function which name is the value of
func
?
UPDATE:
Perhaps thought that what I needed was pretty self-explanatory, but since I'm noticing many downvotes, here you are :
string func = "myfunc";
I need something like call(func)
, which will call myfunc
. Like PHP's call_user_func_array()
Any ideas?
I had a look at mixins but this doesn't look like what I'd need.
P.S. I'm tagging the question with c
and c++
too, since a universal solution could be theoretically possible, given the similarities among the languages.