strings as functions

Mike Papper mpapp at
Mon Jan 7 13:18:10 AEST 1991


Is there a way to use a string value as the name of a function?
In other words, can I use a string (possibly
typed in by a programmer) as a function call to a function of
the same name?

One method may be to call the same function, which uses the value
of the string to decide which real function to call.
In this case the programmer would have to edit the source code that was 
generated to match up the strings and the appropriate function calls.

The idea is to have a program that reads an ASCII file to generate
an interface, which when buttons are selected, the
appropriate function is called. The function to call
would be found in the ascii file, and the program would assume
the programmer had created the function of same name somewhere.


Can this be done? easily?
Mike Papper



More information about the Comp.lang.c mailing list