Re: Function calls using variables



In article <A_mdnXTQnMsKrgbfRVn-ug@xxxxxxxxxxx>,
Eric Sosman <esosman@xxxxxxxxxxxxxxxxxxx> wrote:
>simonjpaulger@xxxxxxxxxxx wrote:
>> In PHP (and other languages too, im not sure), you can call a function
>> using a variable itself, the variables string contains the function
>> name, which in turn runs.
>> [...]
>> Is it possible in C to call functions using variable strings?
>>
>> Can anyone point me in the right direction?
>
> This is Question 20.6 in the comp.lang.c Frequently
>Asked Questions (FAQ) list
>
> http://www.eskimo.com/~scs/C-faq/top.html

(Which basically says the same thing as the first response here - build up
a table mapping strings to function pointers and go from there)

I'm surprised nobody has given the obvious and correct answer - which is:

Ask in comp.unix.programmer and I'll tell you whatever you want to know.

Note: It is actually quite easy (and fun!) to do this - on supported
platforms.

.