I'm not really comfortable with these 'pure virtual' functions or 'abstract
classes' yet, so I don't know if I'm using them right.
But, I have a base class that has a few virtual functions, then I
have a derived class that has those functions defined, plus a few
more. Can I not use the extra functions that are in the derived
class?
I get a "Function3() is not a memober of 'cl_One' error. Do I needCode:class cl_One { public: cl_One(); virtual ~cl_One(); virtual void Function1(void) = 0; virtual void Function2(void) = 0; private: int var1; int var2; }; class cl_Two: public cl_One { public: cl_Two(); ~cl_Two(); void Function1(void); void Function2(void); //extra function.. void Function3(void); private: int var3; int var4; }; cl_One* Cowptr = new cl_Two; Cowptr->Function3();
to include a pure virtual Function3 in cl_One? I can do that, but
not all of my classes that derive from cl_One will use a Function3().
Is it common to just define these unused functions as functions
that do nothing ({}), or am I using these virtual functions completely
wrong?
What do I do?
Thanks,
ethic.