Question: If you are given the name of the function at run time how will you invoke the function?

Solution: * Compile your program with --export-dynamic on the gcc command line
* Link with -ldl (dynamic library handling, needed for dlopen and dlsym
* Call dlopen() with a null parameter, meaning you aren't loading symbols from a file but from the current executable
* Call dlsym() with the name of the function you'll be calling. Note that C++ modifies function names, so If you're trying this with C++, you'd have to either declare this function as extern "C", or figure out what name the function has after compiling. (On unix, you could run nm -s on the object file for this).
* If dlsym() returns non-null, use the returned value as a function pointer to invoke your function.