How would one go about loading compiled C code at run time, and then calling functions within it? Not like simply calling exec().
EDIT: The the program loading the
There is a DIY approach. While the method (and possibility) of doing this varies from system to system, the general idea is to open a file, read the contents of the file into memory, make said memory executable, initialise a function pointer to a valid position within this memory, and there you are.
Of course this is assuming that it's just executable code - quite unlikely. The code probably requires data to be loaded into RAM too, and may require space for global/static variables. You could load this all yourself, but you'd need to go into the executable code and adjust all the memory references in it.
Most operating systems allow dynamic linking, which does all this for you.