C++ Virtual Destructors -
Prototype classes I place the dishes in this way:
Virtual ~ MyClass ();
When the classroom is finalized in a library, I saw that I can not add 'virtual', is it normal, and whether virtual is kept in mind or should I Do something wrong?
For example; When I try to do this, I get a compiler error:
Virtual MyClass :: ~ MyClass () {}
Instead of doing this My question is: virtual
virtual
is used only as part of the member function declaration within class definition
If the member is defined outside the definition of the function class, then the virtual
keyword is not placed there.
Comments
Post a Comment