I have these two classes, one which is derived from the other. When I try to compile I get the error:
In file included from /home/michael/ASD/Lsystems/include/Definition.h:5,
from Definition.cpp:1:
/home/michael/ASD/Lsystems/include/Production.h:16: error: expected class-name before '{' token
I have it working(ie. it inherits) although I ran into a new problem.
The members within Definition get assigned by the member functions, but in the Production class I am only getting their addresses.
For example if within Definition I set Angle = 20, then within Production::hello() I have the line:
cout << Angle << endl;
this prints out a long address rather than 20.
Personally I've never actually inherited a class in code myself (I've never felt the need to do so yet, I'm sure I will some day), so I don't know if that behavior is expected, but if its printing a memory address then reference Angle (&Angle) and it should print it's value.
I don't think it's printing an address. I think that perhaps you have no set it's value correctly before trying to print it. An uninit'd variable will have a strange value.