You need it when dealing with polymorphism and dynamic memory allocation. You can see the effects in the following example: http://codepad.org/nMT5ph0s
You'll notice that the destructor in the first part is not called (shock! horror!). We can remedy this by making the destructor virtual (as shown in the second part).
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum