objective:
executing a string of c(++) code with some kind of function comparable to the exec()
function in python.
example in python:
exec('print("hello world")')
#out:
#hello world
question:
is there a c++ version of exec in python?
Well, technicall, you (maybe) can. But it's hardly a justifiable effort, there are other scripting languages that can be integrated in C++. For example Lua. Just to think about it, the following could work, if you have a method int excuteCode(std::string code)
int userFunc()
{
%code%
}
system
or OS-specific methods)userFunc
and execute it.