So i want to write a program that reads in the arithmetic expression and encodes the expression as a binary tree. After the expression has been read in, the variable assignments are read in and the variables and their values of the variables are placed into the symbol table. Finally the expression is evaluated recursively.
Now I have never programmed in c++ on in java so I am a bit lost of whats wrong with the code that I copied. So I have these .h files that are like this
This one is giveing me errors like this;
1>c:\users\kakashi\documents\project2\minus.h(4) : error C2590: 'Minus' : only a constructor can have a base/member initializer list
1>c:\u
I have a plus.h file that is just like this one but does not give me any trouble
it does pretty much the same thing as the minus.h file so I dont know whats wrong here.
class Plus: public SubExpression
{
public:
Plus(Expression* left, Expression* right): SubExpression(left, right)
{
}
double evaluate()
{
return left->evaluate() + right->evaluate();
}
};