Hi
I have read about inheritance and templates. What I have understood is that,both of them provide reusabilty of code, then what is the basic difference between them and which one should be used in what conditions?
Please help with example
Thanks
Hi
I have read about inheritance and templates. What I have understood is that,both of them provide reusabilty of code, then what is the basic difference between them and which one should be used in what conditions?
Please help with example
Thanks
IMO
Through inheritance you can reuse the *features* of a particular entity.
and
Through templates you can reuse the *functions* defined for interaction with that entity.