I have a struct Tree
that is defined inside Class Parser
. I have methods defined in Parser
that take Tree
as input.
void Parser::InputTree(const Tree& input) {
//uses data from Tree
}
Everything seemed to be working fine. But then I needed to use Tree
outside the class. So I decided to define struct Tree
in a separate header. I included this header in the header file for Parser
. While I see no errors in the header file of Parser, the source file shows errors on my Eclipse. Says member declaration not found pointing to method InputTree
.
My question is, first off is this the right strategy to define a struct in a separate header? Second, what am I doing wrong? Third, I have some enum
types also that I want to use across classes. Where do I define it?