I'm working on a game, and I want to store the character belongs to a unit inside the class that defines the units. (as objects)
This is the defining class. (I use inheritance)
class Units { public: char indicator; Units(); virtual ~Units(); protected: private: }; Units::Units (){} Units::~Units (){} class WoodenBoxClass: public Units { public: WoodenBoxClass.indicator = 'B'; }; During the compilation, when "WoodenBoxClass.indicator = 'B';" comes, I get an error message:
50|error: expected unqualified-id before '.' token
What should I do? The main question is that how can I reach that the "indicator" variable is the same to every "WoodenBoxClass" object?