The text for this exercise reads:
main()
or other functions as a simple
function call.
This is actually very easy. Use the calculator code from 6.1.7
double evaluate(const char* expression) { istrstream a(expression); input = &a; return expr(true); } double evaluate(string str) { return evaluate(str.c_str()); }
Simple isn't it?.
Back to the Exercise Page
Back to my Home Page