Question: C++ Improper Function Definitions in Header Files Explanation: Ensure that the function definitions in header files (e.g., subexpression.h, operand.h, etc.) are correctly defined. How would
C++ Improper Function Definitions in Header Files
Explanation: Ensure that the function definitions in header files (e.g., subexpression.h, operand.h, etc.) are correctly defined.
How would I properly define the header files beyond what I have done?
subexpression.h****
class SubExpression: public Expression{
public:
SubExpression(Expression* left, Expression* right);
static Expression* parse(stringstream& in);
protected:
Expression* left;
Expression* right;
};
operand****
class Operand: public Expression{
public:
static Expression* parse(stringstream& in);
};
variable.h****
class Variable: public Operand{
public:
Variable(string name){
this->name = name;
}
int evaluate();
private:
string name;
};
Step by Step Solution
There are 3 Steps involved in it
Answer In C when you declare a class in a header file h you only specify the class declaration not t... View full answer
Get step-by-step solutions from verified subject matter experts
