I''m making a scripting language that is somewhat similar to Lua, and I''m trying to figure out how to register and execute functions, like Lua does. In Lua, when you want a script to be able to recognize a function that is defined in your program you call lua_register() and it places the function you pass into a variable. I''ve figured out how to do that, my question is, how do I call that function? Below is a (very) simplified representation of how I am implementing all this.
typedef int (*CFunction)();
void RegisterFunc(gsFunc f)
theFunction = f;
int temp = theFunction();
All this compiles, but when I run it it commits and Illegal Op.
Why, and how can I fix it?
(Stolen from Programmer One)
UNIX is an operating system, OS/2 is half an operating system, Windows is a shell, and DOS is a boot partition virus