Hello,
I want to ask if it's possible to evaluate a string in borland c++3.1.
For instance, everytime I start the program I read a string (ex. STR="sin(2*x)+x*x+90", and a value for x(ex. x=10).
It's possible to use the string STR as a macro(or to use it in a file,or in any other way) that would evaluate the string STR as a function with the argument x, and would return his value?
(Just like the function below...)
float STR(int x)
{
return sin(2*x)+x*x+90;
}
Thanks
I want to ask if it's possible to evaluate a string in borland c++3.1.
For instance, everytime I start the program I read a string (ex. STR="sin(2*x)+x*x+90", and a value for x(ex. x=10).
It's possible to use the string STR as a macro(or to use it in a file,or in any other way) that would evaluate the string STR as a function with the argument x, and would return his value?
(Just like the function below...)
float STR(int x)
{
return sin(2*x)+x*x+90;
}
Thanks