Sign in to follow this  
ilavos

need some code

Recommended Posts

I was wondering if anybody out there has any source code ( ms vc++ 6.0 ) that allows strings to be treated has math expressions.By that i mean a string is " evaluated" ( has some guy said) as being a math expression?? It would help me a lot.Thanks ahead.

Share this post


Link to post
Share on other sites
Hi,

I guess what he wants is, for instance to take in a string:

"cos(pi / 2) + 3 * sin(3 * pi / 4)"

And have it evaluated....


If that is so, then you need to give a little more details. :)

What kind of mathematica expressions do you want parsed? If it's only simple operations like +, -, *, /, then I suggest you don't bother looking around, and jus write a library yourself - it's not so hard. If you want more, like varius trig functions, roots, etc, then check out this here site: Fast mathematical expressions parser.

BTW, that above site was the first hit in the mathematical expression parser C++ Google search. I suggest that that is a good resource for such simple things. ;)

Vovan

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this