Re: Function calls using variables
- From: gazelle@xxxxxxxxxxxxxxxxxxx (Kenny McCormack)
- Date: Tue, 31 May 2005 00:40:51 GMT
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.
.
- References:
- Function calls using variables
- From: simonjpaulger
- Re: Function calls using variables
- From: Eric Sosman
- Function calls using variables
- Prev by Date: Re: Translating Free Pascal to GNU C
- Next by Date: hashtable...squid
- Previous by thread: Re: Function calls using variables
- Next by thread: Re: Function calls using variables
- Index(es):