If you just want to compile code and execute it, you can always invoke the compiler with the correct command line options when the user would like to execute the code, and then start / wait on the process that you just compiled. That's probably the most general way to do things. I wouldn't advise it though, as I don't see any practical application. If, on the other hand, you want to do some kind of scripting, you could always encapsulate existing functions and dynamically call them by parsing a script, using a virtual address space within your actual program for the storage of stack variables and dynamically allocated memory.