Templates And Inheritance Code In C