How to make compiler evaluate a user input expression

Lets say I have the expression 3*(5+2); if that expression were in the source code of a C++ program the compiler would evaluate it to be 21. Is there a way I can make the compiler evaluate an expression if it is input??

****I only need +,-,/, and * operators nothing else, along with the use of parentheses****
Last edited on
You will have to build a parser on your own, take a look at this desk calculator sourcecode http://www.research.att.com/~bs/dc_except.c
wow thanx so much!!!
Topic archived. No new replies allowed.