int r=x*x+y*y;
return r+2;
or:
int z=0;
for(int n=0;n!=x;n++) z=z+7;
return z;
The program must then compile this text into machine code and place it in the RAM somewhere. Then the program can call this function a million times by running this piece of machine code in the RAM. (If it is not compiled it would run too slowly).
So the question is: Is there any freeware compilers (not necesarrily C) that I could add to my program in order to compile the code into machine code (otherwise I would have to learn a bit of machine code myself to compile it).
And secondly and most importantly, once the function is in the RAM say at a pointer of 12345. How would you run this bit of code from within your program and then return it to your program. Any ideas or examples from the internet doing this?
Thanks.
[edited by - paulbird on December 26, 2003 10:58:39 AM]