Convert the string "(5/12)*8" to a number?
-
Is there a class or function out there will let me pass in an string equation like "(5/12)*8" and have it return the answer as a double. I am planning on writing a fuction to do this, but thought I would check here first. Thanks in advance. :-D *********************** Tony Fontenot Recreational Solutions tony@recsolutions.com ***********************
-
Is there a class or function out there will let me pass in an string equation like "(5/12)*8" and have it return the answer as a double. I am planning on writing a fuction to do this, but thought I would check here first. Thanks in advance. :-D *********************** Tony Fontenot Recreational Solutions tony@recsolutions.com ***********************
here's one: http://www.codeproject.com/cpp/functionparser.asp -c
ABSURDITY: A statement or belief manifestly inconsistent with one's own opinion.
-
Is there a class or function out there will let me pass in an string equation like "(5/12)*8" and have it return the answer as a double. I am planning on writing a fuction to do this, but thought I would check here first. Thanks in advance. :-D *********************** Tony Fontenot Recreational Solutions tony@recsolutions.com ***********************
What you want is an expression parser. There are several commercial ones available, but none I would recommend. Alexander Berthold has published one here on CP, but I have not used it personally. It can be found here: http://www.codeproject.com/cpp/cxtpackage.asp