I get the warning control reaches end of non-void function and I'm not seeing what causes it.
double ExprTree::evaluate(TNode* p) const
{
if(p->data == "+" || p->data == "-" || p->data == "*" || p->data
== "/")
{
double op1 = evaluate(p->left);
double op2 = evaluate(p->right);
if(p->data == "+")
return op1 + op2;
if(p->data == "-")
return op1 - op2;
if(p->data == "*")
return op1 * op2;
if(p->data == "/")
return op1 / op2;
}
else if(isalpha(p->data[0]))
return getVariable(p->data);
else
return atof((p->data).c_str());
}