-
-
-
-
What is the difference between structures and classes in C++?
There is only one difference ,in classes the members are private by default whereas it is not so in structures.
-
What is virtual constructors/destructors?
Virtual destructors: If an object (with a non-virtual destructor) is destroyed explicitly by applying the delete operator to a base-class pointer to the object, the base-class destructor function (matching the pointer type) is called on the object. There is a simple solution to this problem � declare a virtual base-class destructor. This makes all derived-class destructors virtual even...
-
What do you mean by pure virtual functions?
A pure virtual member function is a member function that the base class forces derived classes to provide. Normally these member functions have no implementation. Pure virtual functions are equated to zero. class Shape { public: virtual void draw() = 0; };