Hello,
I am looking for help for a cast problem:
I want to run functions in thread, using the pthread_create function.
The function to run is the first argument of pthread_create and is
expected to be of type void* (*func)(void*)
My problem is that I want to get the name of the function to run in
a .txt file that I parse at runtime.
I read the file and I get the name in a char* variable.
Now I want that this char* variable is the name of the function to
run. How do I do that?
I want to do something like:
char *func_to_run = scanf(the, good, args);
pthread_create (thread, attr, (magic cast)func_to_run, arg);
Even better, is it possible to test, at run time, that the provided
name is the name of a function that exists somewhere in the compiled
code?
Thanks for any help
Etienne